@jsenv/core 30.3.4 → 30.3.6
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/main.js
CHANGED
|
@@ -10695,13 +10695,27 @@ const getOriginalName = (path, name) => {
|
|
|
10695
10695
|
return getOriginalName(path, importedName);
|
|
10696
10696
|
}
|
|
10697
10697
|
if (binding.path.type === "VariableDeclarator") {
|
|
10698
|
+
const {
|
|
10699
|
+
node
|
|
10700
|
+
} = binding.path;
|
|
10698
10701
|
const {
|
|
10699
10702
|
init
|
|
10700
|
-
} =
|
|
10703
|
+
} = node;
|
|
10701
10704
|
if (init && init.type === "Identifier") {
|
|
10702
10705
|
const previousName = init.name;
|
|
10703
10706
|
return getOriginalName(path, previousName);
|
|
10704
10707
|
}
|
|
10708
|
+
if (node.id && node.id.type === "Identifier") {
|
|
10709
|
+
const {
|
|
10710
|
+
constantViolations
|
|
10711
|
+
} = binding;
|
|
10712
|
+
if (constantViolations && constantViolations.length > 0) {
|
|
10713
|
+
const lastViolation = constantViolations[constantViolations.length - 1];
|
|
10714
|
+
if (lastViolation && lastViolation.node.type === "AssignmentExpression" && lastViolation.node.right.type === "MemberExpression" && lastViolation.node.right.property.type === "Identifier") {
|
|
10715
|
+
return lastViolation.node.right.property.name;
|
|
10716
|
+
}
|
|
10717
|
+
}
|
|
10718
|
+
}
|
|
10705
10719
|
}
|
|
10706
10720
|
return name;
|
|
10707
10721
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/core",
|
|
3
|
-
"version": "30.3.
|
|
3
|
+
"version": "30.3.6",
|
|
4
4
|
"description": "Tool to develop, test and build js projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"@c88/v8-coverage": "0.1.1",
|
|
68
68
|
"@financial-times/polyfill-useragent-normaliser": "1.10.2",
|
|
69
69
|
"@jsenv/abort": "4.2.4",
|
|
70
|
-
"@jsenv/ast": "3.0.
|
|
70
|
+
"@jsenv/ast": "3.0.1",
|
|
71
71
|
"@jsenv/babel-plugins": "1.1.3",
|
|
72
72
|
"@jsenv/plugin-bundling": "1.1.2",
|
|
73
73
|
"@jsenv/filesystem": "4.1.9",
|
|
@@ -274,11 +274,26 @@ const getOriginalName = (path, name) => {
|
|
|
274
274
|
return getOriginalName(path, importedName)
|
|
275
275
|
}
|
|
276
276
|
if (binding.path.type === "VariableDeclarator") {
|
|
277
|
-
const {
|
|
277
|
+
const { node } = binding.path
|
|
278
|
+
const { init } = node
|
|
278
279
|
if (init && init.type === "Identifier") {
|
|
279
280
|
const previousName = init.name
|
|
280
281
|
return getOriginalName(path, previousName)
|
|
281
282
|
}
|
|
283
|
+
if (node.id && node.id.type === "Identifier") {
|
|
284
|
+
const { constantViolations } = binding
|
|
285
|
+
if (constantViolations && constantViolations.length > 0) {
|
|
286
|
+
const lastViolation = constantViolations[constantViolations.length - 1]
|
|
287
|
+
if (
|
|
288
|
+
lastViolation &&
|
|
289
|
+
lastViolation.node.type === "AssignmentExpression" &&
|
|
290
|
+
lastViolation.node.right.type === "MemberExpression" &&
|
|
291
|
+
lastViolation.node.right.property.type === "Identifier"
|
|
292
|
+
) {
|
|
293
|
+
return lastViolation.node.right.property.name
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
282
297
|
}
|
|
283
298
|
return name
|
|
284
299
|
}
|