@plumeria/utils 18.3.11 → 18.3.13

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.
Files changed (2) hide show
  1. package/dist/parser.js +17 -9
  2. package/package.json +1 -1
package/dist/parser.js CHANGED
@@ -825,15 +825,23 @@ function resolveVariantsTableMemberExpression(node, variantsHashTable) {
825
825
  }
826
826
  }
827
827
  function resolveStaticTableMemberExpression(node, staticTable) {
828
- if (exports.t.isIdentifier(node.object) && exports.t.isIdentifier(node.property)) {
829
- const varName = node.object.value;
830
- const key = node.property.value;
831
- const tableValue = staticTable[varName];
832
- if (tableValue && typeof tableValue === 'object' && key in tableValue) {
833
- return tableValue[key];
834
- }
828
+ const keys = [];
829
+ let current = node;
830
+ while (exports.t.isMemberExpression(current)) {
831
+ if (!exports.t.isIdentifier(current.property))
832
+ return undefined;
833
+ keys.unshift(current.property.value);
834
+ current = current.object;
835
835
  }
836
- return undefined;
836
+ if (!exports.t.isIdentifier(current))
837
+ return undefined;
838
+ let value = staticTable[current.value];
839
+ for (const key of keys) {
840
+ if (!value || typeof value !== 'object' || !(key in value))
841
+ return undefined;
842
+ value = value[key];
843
+ }
844
+ return value;
837
845
  }
838
846
  function resolveCreateThemeTableMemberExpressionByNode(node, createThemeHashTable, createThemeObjectTable) {
839
847
  if (exports.t.isMemberExpression(node) && exports.t.isIdentifier(node.object)) {
@@ -1820,7 +1828,7 @@ function resolveExport(filePath, exportName, visited = new Set()) {
1820
1828
  }
1821
1829
  }
1822
1830
  else {
1823
- return resolveExport(filePath, localName, visited);
1831
+ return (resolveExport(filePath, localName, visited) ?? { filePath, localName });
1824
1832
  }
1825
1833
  }
1826
1834
  if (localExports.includes(exportName)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/utils",
3
- "version": "18.3.11",
3
+ "version": "18.3.13",
4
4
  "description": "Plumeria Utils",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",