@zipbul/gildash 0.27.0 → 0.27.1
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/dist/src/parser/ast-utils.d.ts +20 -20
- package/package.json +1 -1
|
@@ -12,18 +12,18 @@ export declare function getNodeHeader(node: Record<string, unknown>, parent?: Re
|
|
|
12
12
|
* `.params` / `.body` should be aware that `body` may be `null` only on the
|
|
13
13
|
* declare/empty-body variants (excluded by this predicate).
|
|
14
14
|
*/
|
|
15
|
-
export declare function isFunctionNode(node: Node): node is
|
|
15
|
+
export declare function isFunctionNode(node: Node): node is Node & {
|
|
16
16
|
type: 'FunctionDeclaration' | 'FunctionExpression' | 'ArrowFunctionExpression';
|
|
17
|
-
}
|
|
18
|
-
export declare function isArrowFunctionExpression(node: Node): node is
|
|
17
|
+
};
|
|
18
|
+
export declare function isArrowFunctionExpression(node: Node): node is Node & {
|
|
19
19
|
type: 'ArrowFunctionExpression';
|
|
20
|
-
}
|
|
21
|
-
export declare function isAssignmentExpression(node: Node): node is
|
|
20
|
+
};
|
|
21
|
+
export declare function isAssignmentExpression(node: Node): node is Node & {
|
|
22
22
|
type: 'AssignmentExpression';
|
|
23
|
-
}
|
|
24
|
-
export declare function isCallExpression(node: Node): node is
|
|
23
|
+
};
|
|
24
|
+
export declare function isCallExpression(node: Node): node is Node & {
|
|
25
25
|
type: 'CallExpression';
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
27
|
/**
|
|
28
28
|
* Note: discriminator `"FunctionDeclaration"` narrows to the `Function`
|
|
29
29
|
* interface, which structurally also accepts `type: 'TSDeclareFunction'` and
|
|
@@ -31,13 +31,13 @@ export declare function isCallExpression(node: Node): node is Extract<Node, {
|
|
|
31
31
|
* runtime check. Narrowed result has `.params` (always) and `.body` (typed
|
|
32
32
|
* `FunctionBody | null`; non-null for FunctionDeclaration / FunctionExpression).
|
|
33
33
|
*/
|
|
34
|
-
export declare function isFunctionDeclaration(node: Node): node is
|
|
34
|
+
export declare function isFunctionDeclaration(node: Node): node is Node & {
|
|
35
35
|
type: 'FunctionDeclaration';
|
|
36
|
-
}
|
|
36
|
+
};
|
|
37
37
|
/** See `isFunctionDeclaration` for shared `Function` interface notes. */
|
|
38
|
-
export declare function isFunctionExpression(node: Node): node is
|
|
38
|
+
export declare function isFunctionExpression(node: Node): node is Node & {
|
|
39
39
|
type: 'FunctionExpression';
|
|
40
|
-
}
|
|
40
|
+
};
|
|
41
41
|
/**
|
|
42
42
|
* Note: discriminator `"Identifier"` is shared by 6 interfaces in
|
|
43
43
|
* @oxc-project/types — IdentifierName, IdentifierReference, BindingIdentifier,
|
|
@@ -46,9 +46,9 @@ export declare function isFunctionExpression(node: Node): node is Extract<Node,
|
|
|
46
46
|
* union of all 6; callers needing finer distinction must check additional
|
|
47
47
|
* fields (e.g. TSThisParameter has `decorators: []` and `optional: false`).
|
|
48
48
|
*/
|
|
49
|
-
export declare function isIdentifier(node: Node): node is
|
|
49
|
+
export declare function isIdentifier(node: Node): node is Node & {
|
|
50
50
|
type: 'Identifier';
|
|
51
|
-
}
|
|
51
|
+
};
|
|
52
52
|
/**
|
|
53
53
|
* Note: discriminator `"MemberExpression"` is shared by 3 interfaces —
|
|
54
54
|
* ComputedMemberExpression, StaticMemberExpression, PrivateFieldExpression.
|
|
@@ -56,21 +56,21 @@ export declare function isIdentifier(node: Node): node is Extract<Node, {
|
|
|
56
56
|
* `.field`). Callers needing finer distinction should check `.computed`
|
|
57
57
|
* (Computed only) or the property-side field shape.
|
|
58
58
|
*/
|
|
59
|
-
export declare function isMemberExpression(node: Node): node is
|
|
59
|
+
export declare function isMemberExpression(node: Node): node is Node & {
|
|
60
60
|
type: 'MemberExpression';
|
|
61
|
-
}
|
|
61
|
+
};
|
|
62
62
|
/**
|
|
63
63
|
* Note: discriminator `"TSQualifiedName"` is shared by 2 interfaces —
|
|
64
64
|
* TSQualifiedName and TSImportTypeQualifiedName. Both expose `.left` and
|
|
65
65
|
* `.right`, but `.left` shape differs (TSQualifiedName: TSQualifiedName |
|
|
66
66
|
* IdentifierName; TSImportTypeQualifiedName: TSImportTypeQualifier).
|
|
67
67
|
*/
|
|
68
|
-
export declare function isTSQualifiedName(node: Node): node is
|
|
68
|
+
export declare function isTSQualifiedName(node: Node): node is Node & {
|
|
69
69
|
type: 'TSQualifiedName';
|
|
70
|
-
}
|
|
71
|
-
export declare function isVariableDeclaration(node: Node): node is
|
|
70
|
+
};
|
|
71
|
+
export declare function isVariableDeclaration(node: Node): node is Node & {
|
|
72
72
|
type: 'VariableDeclaration';
|
|
73
|
-
}
|
|
73
|
+
};
|
|
74
74
|
export declare function getNodeName(node: unknown): string | null;
|
|
75
75
|
export declare function getStringLiteralValue(node: unknown): string | null;
|
|
76
76
|
export declare function getQualifiedName(expr: unknown): QualifiedName | null;
|