@appland/scanner 1.81.0 → 1.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ # [@appland/scanner-v1.82.0](https://github.com/getappmap/appmap-js/compare/@appland/scanner-v1.81.1...@appland/scanner-v1.82.0) (2023-08-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Fix caching of unparseable SQL ([e81db08](https://github.com/getappmap/appmap-js/commit/e81db08d6f6a7b661f77aa3aead5e800e15a7358))
7
+
8
+
9
+ ### Features
10
+
11
+ * Analyze in worker threads ([612da06](https://github.com/getappmap/appmap-js/commit/612da06532e765469094aaeaaf614a52e75e46d2))
12
+
13
+ # [@appland/scanner-v1.81.1](https://github.com/getappmap/appmap-js/compare/@appland/scanner-v1.81.0...@appland/scanner-v1.81.1) (2023-08-11)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * Specify node version requirements for user-facing packages ([ca55a25](https://github.com/getappmap/appmap-js/commit/ca55a256e5fb79b990eff87a753980de549a4b88))
19
+
1
20
  # [@appland/scanner-v1.81.0](https://github.com/getappmap/appmap-js/compare/@appland/scanner-v1.80.2...@appland/scanner-v1.81.0) (2023-08-09)
2
21
 
3
22
 
@@ -15,12 +15,19 @@ class AppMapIndex {
15
15
  if (!event.sql)
16
16
  throw new Error(`${event.fqid} is not a SQL query`);
17
17
  const sql = this.sqlNormalized(event);
18
- let ast = ASTBySQLString.get(sql);
19
- if (!ast) {
20
- ast = (0, models_1.parseSQL)(sql);
21
- ast ? ASTBySQLString.set(sql, ast) : ASTBySQLString.set(sql, null);
18
+ let result;
19
+ const cachedAST = ASTBySQLString.get(sql);
20
+ if (cachedAST === 'parse-error') {
21
+ result = undefined;
22
22
  }
23
- return ast;
23
+ else if (cachedAST) {
24
+ result = cachedAST;
25
+ }
26
+ else {
27
+ result = (0, models_1.parseSQL)(sql);
28
+ ASTBySQLString.set(sql, result ? result : 'parse-error');
29
+ }
30
+ return result;
24
31
  }
25
32
  sqlNormalized(event) {
26
33
  if (!event.sql)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appland/scanner",
3
- "version": "1.81.0",
3
+ "version": "1.82.0",
4
4
  "description": "Analyze AppMaps for code flaws",
5
5
  "bin": "built/cli.js",
6
6
  "main": "built/index.js",
@@ -91,6 +91,9 @@
91
91
  "tar-stream": "^2.2.0",
92
92
  "yargs": "^17.1.1"
93
93
  },
94
+ "engines": {
95
+ "node": ">15"
96
+ },
94
97
  "publishConfig": {
95
98
  "access": "public"
96
99
  },