astronomical 1.0.0 → 2.0.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/lib/cjs/index.js +351 -61
- package/lib/cjs/nodeutils.js +34 -33
- package/lib/cjs/parseQuery.js +10 -12
- package/lib/cjs/types/index.d.ts +37 -2
- package/lib/cjs/types/index.d.ts.map +1 -1
- package/lib/cjs/types/nodeutils.d.ts +14 -14
- package/lib/cjs/types/nodeutils.d.ts.map +1 -1
- package/lib/cjs/utils.js +2 -3
- package/lib/esm/index.mjs +351 -61
- package/lib/esm/nodeutils.js +34 -33
- package/lib/esm/parseQuery.js +10 -12
- package/lib/esm/types/index.d.ts +37 -2
- package/lib/esm/types/index.d.ts.map +1 -1
- package/lib/esm/types/nodeutils.d.ts +14 -14
- package/lib/esm/types/nodeutils.d.ts.map +1 -1
- package/lib/esm/utils.js +2 -3
- package/package.json +3 -2
- package/lib/cjs/traverse.js +0 -239
- package/lib/cjs/types/traverse.d.ts +0 -39
- package/lib/cjs/types/traverse.d.ts.map +0 -1
- package/lib/esm/traverse.js +0 -239
- package/lib/esm/types/traverse.d.ts +0 -39
- package/lib/esm/types/traverse.d.ts.map +0 -1
package/lib/cjs/nodeutils.js
CHANGED
|
@@ -1,55 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
3
|
+
exports.VISITOR_KEYS = exports.isBinding = exports.isVariableDeclaration = exports.isVariableDeclarator = exports.isFunctionExpression = exports.isFunctionDeclaration = exports.isIdentifier = exports.isMemberExpression = exports.isAssignmentExpression = exports.isUpdateExpression = exports.isPrimitive = exports.isLiteral = exports.isNodePath = exports.isNode = void 0;
|
|
4
|
+
exports.isScope = isScope;
|
|
5
|
+
exports.isScopable = isScopable;
|
|
6
|
+
exports.isExportSpecifier = isExportSpecifier;
|
|
7
|
+
const isNode = (candidate) => {
|
|
5
8
|
return typeof candidate === "object" && candidate != null && "type" in candidate;
|
|
6
|
-
}
|
|
9
|
+
};
|
|
7
10
|
exports.isNode = isNode;
|
|
8
|
-
|
|
11
|
+
const isNodePath = (candidate) => {
|
|
9
12
|
return typeof candidate === "object" && candidate != null && "node" in candidate;
|
|
10
|
-
}
|
|
13
|
+
};
|
|
11
14
|
exports.isNodePath = isNodePath;
|
|
12
|
-
|
|
13
|
-
return isNode(candidate) && candidate.type === "Literal";
|
|
14
|
-
}
|
|
15
|
+
const isLiteral = (candidate) => {
|
|
16
|
+
return (0, exports.isNode)(candidate) && candidate.type === "Literal";
|
|
17
|
+
};
|
|
15
18
|
exports.isLiteral = isLiteral;
|
|
16
|
-
|
|
19
|
+
const isPrimitive = (value) => {
|
|
17
20
|
return typeof value == "string" || typeof value == "number" || typeof value == "boolean";
|
|
18
|
-
}
|
|
21
|
+
};
|
|
19
22
|
exports.isPrimitive = isPrimitive;
|
|
20
|
-
|
|
21
|
-
return isNode(value) && value.type === "UpdateExpression";
|
|
22
|
-
}
|
|
23
|
+
const isUpdateExpression = (value) => {
|
|
24
|
+
return (0, exports.isNode)(value) && value.type === "UpdateExpression";
|
|
25
|
+
};
|
|
23
26
|
exports.isUpdateExpression = isUpdateExpression;
|
|
24
|
-
|
|
27
|
+
const isAssignmentExpression = (node) => {
|
|
25
28
|
return node.type === "AssignmentExpression";
|
|
26
|
-
}
|
|
29
|
+
};
|
|
27
30
|
exports.isAssignmentExpression = isAssignmentExpression;
|
|
28
|
-
|
|
31
|
+
const isMemberExpression = (node) => {
|
|
29
32
|
return node.type === "MemberExpression";
|
|
30
|
-
}
|
|
33
|
+
};
|
|
31
34
|
exports.isMemberExpression = isMemberExpression;
|
|
32
|
-
|
|
35
|
+
const isIdentifier = (node) => {
|
|
33
36
|
return node.type === "Identifier";
|
|
34
|
-
}
|
|
37
|
+
};
|
|
35
38
|
exports.isIdentifier = isIdentifier;
|
|
36
|
-
|
|
39
|
+
const isFunctionDeclaration = (node) => {
|
|
37
40
|
return node.type === "FunctionDeclaration";
|
|
38
|
-
}
|
|
41
|
+
};
|
|
39
42
|
exports.isFunctionDeclaration = isFunctionDeclaration;
|
|
40
|
-
|
|
43
|
+
const isFunctionExpression = (node) => {
|
|
41
44
|
return node.type === "FunctionExpression";
|
|
42
|
-
}
|
|
45
|
+
};
|
|
43
46
|
exports.isFunctionExpression = isFunctionExpression;
|
|
44
|
-
|
|
47
|
+
const isVariableDeclarator = (node) => {
|
|
45
48
|
return node.type === "VariableDeclarator";
|
|
46
|
-
}
|
|
49
|
+
};
|
|
47
50
|
exports.isVariableDeclarator = isVariableDeclarator;
|
|
48
|
-
|
|
51
|
+
const isVariableDeclaration = (node) => {
|
|
49
52
|
return node.type === "VariableDeclaration";
|
|
50
|
-
}
|
|
53
|
+
};
|
|
51
54
|
exports.isVariableDeclaration = isVariableDeclaration;
|
|
52
|
-
|
|
55
|
+
const isBinding = (node, parentNode, grandParentNode) => {
|
|
53
56
|
if (grandParentNode &&
|
|
54
57
|
node.type === "Identifier" &&
|
|
55
58
|
parentNode.type === "Property" &&
|
|
@@ -72,7 +75,7 @@ function isBinding(node, parentNode, grandParentNode) {
|
|
|
72
75
|
}
|
|
73
76
|
}
|
|
74
77
|
return false;
|
|
75
|
-
}
|
|
78
|
+
};
|
|
76
79
|
exports.isBinding = isBinding;
|
|
77
80
|
const bindingIdentifiersKeys = {
|
|
78
81
|
DeclareClass: ["id"],
|
|
@@ -148,6 +151,7 @@ exports.VISITOR_KEYS = {
|
|
|
148
151
|
FunctionExpression: ["id", "params", "body"],
|
|
149
152
|
Identifier: [],
|
|
150
153
|
IfStatement: ["test", "consequent", "alternate"],
|
|
154
|
+
ImportAttribute: ["key", "value"],
|
|
151
155
|
ImportDeclaration: ["specifiers", "source"],
|
|
152
156
|
ImportDefaultSpecifier: ["local"],
|
|
153
157
|
ImportNamespaceSpecifier: ["local"],
|
|
@@ -227,9 +231,8 @@ function isScope(node, parentNode) {
|
|
|
227
231
|
if (isPattern(node) && (isFunction(parentNode) || isCatchClause(parentNode))) {
|
|
228
232
|
return true;
|
|
229
233
|
}
|
|
230
|
-
return isFunctionDeclaration(parentNode) || isFunctionExpression(parentNode) || isScopable(node);
|
|
234
|
+
return (0, exports.isFunctionDeclaration)(parentNode) || (0, exports.isFunctionExpression)(parentNode) || isScopable(node);
|
|
231
235
|
}
|
|
232
|
-
exports.isScope = isScope;
|
|
233
236
|
function isScopable(node) {
|
|
234
237
|
switch (node.type) {
|
|
235
238
|
case "BlockStatement":
|
|
@@ -252,8 +255,6 @@ function isScopable(node) {
|
|
|
252
255
|
}
|
|
253
256
|
return false;
|
|
254
257
|
}
|
|
255
|
-
exports.isScopable = isScopable;
|
|
256
258
|
function isExportSpecifier(node) {
|
|
257
259
|
return node.type === "ExportSpecifier";
|
|
258
260
|
}
|
|
259
|
-
exports.isExportSpecifier = isExportSpecifier;
|
package/lib/cjs/parseQuery.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.tokenize = tokenize;
|
|
4
|
+
exports.parse = parse;
|
|
4
5
|
const _1 = require(".");
|
|
5
6
|
const nodeutils_1 = require("./nodeutils");
|
|
6
7
|
const debugLogEnabled = false;
|
|
7
|
-
const log = {
|
|
8
|
+
const log = debugLogEnabled ? {
|
|
8
9
|
debug: (...args) => {
|
|
9
|
-
|
|
10
|
-
console.debug(...args);
|
|
10
|
+
console.debug(...args);
|
|
11
11
|
}
|
|
12
|
-
};
|
|
12
|
+
} : undefined;
|
|
13
13
|
const supportedIdentifiers = Object.fromEntries(Object.keys(nodeutils_1.VISITOR_KEYS).map(k => [k, k]));
|
|
14
14
|
function isIdentifierToken(token) {
|
|
15
15
|
if (token == undefined)
|
|
@@ -149,9 +149,8 @@ function tokenize(input) {
|
|
|
149
149
|
}
|
|
150
150
|
return result;
|
|
151
151
|
}
|
|
152
|
-
exports.tokenize = tokenize;
|
|
153
152
|
function buildFilter(tokens) {
|
|
154
|
-
log
|
|
153
|
+
log?.debug("BUILD FILTER", tokens);
|
|
155
154
|
tokens.shift();
|
|
156
155
|
const p = buildTree(tokens);
|
|
157
156
|
const next = tokens[0];
|
|
@@ -198,7 +197,7 @@ function buildFilter(tokens) {
|
|
|
198
197
|
}
|
|
199
198
|
const subNodes = ["child", "descendant"];
|
|
200
199
|
function buildTree(tokens) {
|
|
201
|
-
log
|
|
200
|
+
log?.debug("BUILD TREE", tokens);
|
|
202
201
|
if (tokens.length == 0)
|
|
203
202
|
throw new Error("Unexpected end of input");
|
|
204
203
|
const token = tokens.shift();
|
|
@@ -241,7 +240,7 @@ function buildTree(tokens) {
|
|
|
241
240
|
let filter = undefined;
|
|
242
241
|
if (tokens.length > 0 && tokens[0].type == "filterBegin") {
|
|
243
242
|
filter = buildFilter(tokens);
|
|
244
|
-
log
|
|
243
|
+
log?.debug("FILTER", filter, tokens);
|
|
245
244
|
}
|
|
246
245
|
let child = undefined;
|
|
247
246
|
if (tokens.length > 0 && subNodes.includes(tokens[0].type)) {
|
|
@@ -268,7 +267,7 @@ function buildTree(tokens) {
|
|
|
268
267
|
throw new Error("Unexpected token: " + token.type);
|
|
269
268
|
}
|
|
270
269
|
function buildFunctionCall(name, tokens) {
|
|
271
|
-
log
|
|
270
|
+
log?.debug("BUILD FUNCTION", name, tokens);
|
|
272
271
|
const parameters = [];
|
|
273
272
|
const next = tokens.shift();
|
|
274
273
|
if (next?.type != "parametersBegin")
|
|
@@ -290,9 +289,8 @@ function buildFunctionCall(name, tokens) {
|
|
|
290
289
|
function parse(input) {
|
|
291
290
|
const tokens = tokenize(input);
|
|
292
291
|
const result = buildTree(tokens);
|
|
293
|
-
log
|
|
292
|
+
log?.debug("RESULT", result);
|
|
294
293
|
if (!result)
|
|
295
294
|
throw new Error("No root element found");
|
|
296
295
|
return result;
|
|
297
296
|
}
|
|
298
|
-
exports.parse = parse;
|
package/lib/cjs/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ESTree } from "meriyah";
|
|
2
2
|
export declare const functions: {
|
|
3
3
|
join: {
|
|
4
4
|
fn: (result: Result[][]) => Result[];
|
|
@@ -23,6 +23,41 @@ export declare function query(code: string | ASTNode, query: string, returnAST?:
|
|
|
23
23
|
export declare function multiQuery<T extends Record<string, string>>(code: string | ASTNode, namedQueries: T, returnAST?: boolean): Record<keyof T, Result[]> & {
|
|
24
24
|
__AST?: ASTNode;
|
|
25
25
|
};
|
|
26
|
-
export declare function parseSource(source: string): ASTNode;
|
|
26
|
+
export declare function parseSource(source: string, optimize?: boolean): ASTNode;
|
|
27
|
+
export type Binding = {
|
|
28
|
+
path: NodePath;
|
|
29
|
+
};
|
|
30
|
+
export type Scope = {
|
|
31
|
+
bindings: Record<string, Binding>;
|
|
32
|
+
parentScopeId?: number;
|
|
33
|
+
id: number;
|
|
34
|
+
};
|
|
35
|
+
export type ASTNode = ESTree.Node & {
|
|
36
|
+
extra?: {
|
|
37
|
+
scopeId?: number;
|
|
38
|
+
functionScopeId?: number;
|
|
39
|
+
nodePath?: NodePath;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export type NodePath = {
|
|
43
|
+
node: ASTNode;
|
|
44
|
+
key?: string;
|
|
45
|
+
parentPath?: NodePath;
|
|
46
|
+
parentKey?: string;
|
|
47
|
+
scopeId: number;
|
|
48
|
+
functionScopeId: number;
|
|
49
|
+
};
|
|
50
|
+
type Visitor<T> = {
|
|
51
|
+
enter: (path: NodePath, state: T) => void;
|
|
52
|
+
exit: (path: NodePath, state: T) => void;
|
|
53
|
+
};
|
|
54
|
+
export default function createTraverser(): {
|
|
55
|
+
traverse: <T>(node: ASTNode, visitor: Visitor<T>, scopeId: number | undefined, state: T, path?: NodePath) => void;
|
|
56
|
+
createNodePath: (node: ASTNode, key: string | undefined | number, parentKey: string | undefined, scopeId: number | undefined, functionScopeId: number | undefined, nodePath?: NodePath) => NodePath;
|
|
57
|
+
getChildren: (key: string, path: NodePath) => NodePath[];
|
|
58
|
+
getPrimitiveChildren: (key: string, path: NodePath) => PrimitiveValue[];
|
|
59
|
+
getPrimitiveChildrenOrNodePaths: (key: string, path: NodePath) => Array<PrimitiveValue | NodePath>;
|
|
60
|
+
getBinding: (scopeId: number, name: string) => Binding | undefined;
|
|
61
|
+
};
|
|
27
62
|
export {};
|
|
28
63
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAYjC,eAAO,MAAM,SAAS;;qBAEL,MAAM,EAAE,EAAE,KAAG,MAAM,EAAE;;;qBAWrB,MAAM,EAAE,EAAE,KAAG,MAAM,EAAE;;;qBAMrB,MAAM,EAAE,EAAE,KAAG,MAAM,EAAE;;;qBAOrB,MAAM,EAAE,EAAE,KAAG,MAAM,EAAE;;CASrC,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,SAAS,CAAC;AACvD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAI,IAAI,IAAI,iBAAiB,CAE5E;AAGD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEvD,KAAK,MAAM,GAAG,OAAO,GAAG,cAAc,CAAC;AAobvC,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,OAAO,GAAI,MAAM,EAAE,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAQjH;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAA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OAAO,UAAU,eAAe;eAwOnB,CAAC,QAAU,OAAO,WACzB,OAAO,CAAC,CAAC,CAAC,WACV,MAAM,GAAG,SAAS,SACpB,CAAC,SACD,QAAQ;2BAjJa,OAAO,OAAO,MAAM,GAAG,SAAS,GAAG,MAAM,aAAa,MAAM,GAAG,SAAS,WAAW,MAAM,GAAG,SAAS,mBAAmB,MAAM,GAAG,SAAS,aAAa,QAAQ,KAAI,QAAQ;uBAtC/K,MAAM,QAAQ,QAAQ,KAAI,QAAQ,EAAE;gCAW3B,MAAM,QAAQ,QAAQ,KAAI,cAAc,EAAE;2CAO/B,MAAM,QAAQ,QAAQ,KAAI,KAAK,CAAC,cAAc,GAAG,QAAQ,CAAC;0BA1D3E,MAAM,QAAQ,MAAM,KAAG,OAAO,GAAG,SAAS;EAmPxE"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { ESTree } from "meriyah";
|
|
2
|
-
import { ASTNode, NodePath } from "
|
|
2
|
+
import { ASTNode, NodePath } from ".";
|
|
3
3
|
import { PrimitiveValue } from ".";
|
|
4
|
-
export declare
|
|
5
|
-
export declare
|
|
6
|
-
export declare
|
|
7
|
-
export declare
|
|
8
|
-
export declare
|
|
9
|
-
export declare
|
|
10
|
-
export declare
|
|
11
|
-
export declare
|
|
12
|
-
export declare
|
|
13
|
-
export declare
|
|
14
|
-
export declare
|
|
15
|
-
export declare
|
|
16
|
-
export declare
|
|
4
|
+
export declare const isNode: (candidate: unknown) => candidate is ASTNode;
|
|
5
|
+
export declare const isNodePath: (candidate: unknown) => candidate is NodePath;
|
|
6
|
+
export declare const isLiteral: (candidate: unknown) => candidate is ESTree.Literal;
|
|
7
|
+
export declare const isPrimitive: (value: unknown) => value is PrimitiveValue;
|
|
8
|
+
export declare const isUpdateExpression: (value: unknown) => value is ESTree.UpdateExpression;
|
|
9
|
+
export declare const isAssignmentExpression: (node: ESTree.Node) => node is ESTree.AssignmentExpression;
|
|
10
|
+
export declare const isMemberExpression: (node: ESTree.Node) => node is ESTree.MemberExpression;
|
|
11
|
+
export declare const isIdentifier: (node: ESTree.Node) => node is ESTree.Identifier;
|
|
12
|
+
export declare const isFunctionDeclaration: (node: ESTree.Node) => node is ESTree.FunctionDeclaration;
|
|
13
|
+
export declare const isFunctionExpression: (node: ESTree.Node) => node is ESTree.FunctionExpression;
|
|
14
|
+
export declare const isVariableDeclarator: (node: ESTree.Node) => node is ESTree.VariableDeclarator;
|
|
15
|
+
export declare const isVariableDeclaration: (node: ESTree.Node) => node is ESTree.VariableDeclaration;
|
|
16
|
+
export declare const isBinding: (node: ESTree.Node, parentNode: ESTree.Node, grandParentNode: ESTree.Node | undefined) => boolean;
|
|
17
17
|
export declare const VISITOR_KEYS: Record<ESTree.Node["type"], string[]>;
|
|
18
18
|
export declare function isScope(node: ESTree.Node, parentNode: ESTree.Node): boolean;
|
|
19
19
|
export declare function isScopable(node: ESTree.Node): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeutils.d.ts","sourceRoot":"","sources":["../../../src/nodeutils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"nodeutils.d.ts","sourceRoot":"","sources":["../../../src/nodeutils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC;AAEnC,eAAO,MAAM,MAAM,GAAI,WAAW,OAAO,KAAI,SAAS,IAAI,OAEzD,CAAA;AAED,eAAO,MAAM,UAAU,GAAI,WAAW,OAAO,KAAI,SAAS,IAAI,QAE7D,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,WAAW,OAAO,KAAI,SAAS,IAAI,MAAM,CAAC,OAE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E;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,OAAO,CAqBrD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,IAAI,MAAM,CAAC,eAAe,CAEnF"}
|
package/lib/cjs/utils.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.toArray = toArray;
|
|
4
|
+
exports.isDefined = isDefined;
|
|
4
5
|
function toArray(value) {
|
|
5
6
|
return Array.isArray(value) ? value : [value];
|
|
6
7
|
}
|
|
7
|
-
exports.toArray = toArray;
|
|
8
8
|
function isDefined(value) {
|
|
9
9
|
return value != undefined && value != null;
|
|
10
10
|
}
|
|
11
|
-
exports.isDefined = isDefined;
|