@umijs/ast 4.6.66 → 4.6.68
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getASTByFilePath(filePath: string): import("@umijs/bundler-utils/compiled
|
|
1
|
+
export declare function getASTByFilePath(filePath: string): import("@umijs/bundler-utils/compiled/babel/types").File | null;
|
|
@@ -44,7 +44,8 @@ function getExportProps(code) {
|
|
|
44
44
|
enter(path) {
|
|
45
45
|
const node = path.node;
|
|
46
46
|
const defaultExport = findExportDefault(node);
|
|
47
|
-
if (!defaultExport)
|
|
47
|
+
if (!defaultExport)
|
|
48
|
+
return;
|
|
48
49
|
if (t.isIdentifier(defaultExport)) {
|
|
49
50
|
const { name } = defaultExport;
|
|
50
51
|
props = findAssignmentExpressionProps({
|
|
@@ -3,8 +3,8 @@ interface IResolver<U> {
|
|
|
3
3
|
is(src: any): boolean;
|
|
4
4
|
get(src: U): any;
|
|
5
5
|
}
|
|
6
|
-
export declare const LITERAL_NODE_RESOLVERS: (IResolver<t.
|
|
7
|
-
export declare const NODE_RESOLVERS: (IResolver<t.
|
|
6
|
+
export declare const LITERAL_NODE_RESOLVERS: (IResolver<t.ArrayExpression> | IResolver<t.BooleanLiteral> | IResolver<t.Identifier> | IResolver<t.NullLiteral> | IResolver<t.NumericLiteral> | IResolver<t.ObjectExpression> | IResolver<t.StringLiteral>)[];
|
|
7
|
+
export declare const NODE_RESOLVERS: (IResolver<t.ArrayExpression> | IResolver<t.ArrowFunctionExpression> | IResolver<t.BooleanLiteral> | IResolver<t.FunctionExpression> | IResolver<t.Identifier> | IResolver<t.NullLiteral> | IResolver<t.NumericLiteral> | IResolver<t.ObjectExpression> | IResolver<t.StringLiteral> | IResolver<t.Class>)[];
|
|
8
8
|
export declare function findObjectLiteralProperties(node: t.ObjectExpression): {};
|
|
9
9
|
export declare function findObjectMembers(node: t.ObjectExpression): {};
|
|
10
10
|
export declare function findClassStaticProperty(node: t.Class): {} | undefined;
|
|
@@ -196,7 +196,8 @@ function findClassStaticProperty(node) {
|
|
|
196
196
|
return "static" in p && p.static === true;
|
|
197
197
|
}
|
|
198
198
|
let body = node.body;
|
|
199
|
-
if (!t.isClassBody(body))
|
|
199
|
+
if (!t.isClassBody(body))
|
|
200
|
+
return;
|
|
200
201
|
const target = {};
|
|
201
202
|
body.body.forEach((p) => {
|
|
202
203
|
if (isStaticNode(p) && t.isIdentifier(p.key)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/ast",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.68",
|
|
4
4
|
"description": "@umijs/ast",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/ast#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@umijs/bundler-utils": "4.6.
|
|
18
|
+
"@umijs/bundler-utils": "4.6.68"
|
|
19
19
|
},
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"access": "public"
|