@bamboocss/extractor 1.29.0 → 1.30.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/dist/index.cjs +6 -12
- package/dist/index.mjs +6 -12
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -758,21 +758,15 @@ function maybeBoxNode(node, stack, ctx, matchProp) {
|
|
|
758
758
|
let fnName = "";
|
|
759
759
|
let isValueMethod = false;
|
|
760
760
|
if (ts_morph.Node.isIdentifier(expr)) fnName = expr.getText();
|
|
761
|
-
else if (ts_morph.Node.isPropertyAccessExpression(expr)) {
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
fnName = expr.getExpression().getText();
|
|
766
|
-
} else fnName = expr.getText();
|
|
767
|
-
}
|
|
761
|
+
else if (ts_morph.Node.isPropertyAccessExpression(expr)) if (expr.getName() === "value") {
|
|
762
|
+
isValueMethod = true;
|
|
763
|
+
fnName = expr.getExpression().getText();
|
|
764
|
+
} else fnName = expr.getText();
|
|
768
765
|
if (ctx.tokens.isTokenFn ? ctx.tokens.isTokenFn(fnName) : fnName === "token") {
|
|
769
|
-
const
|
|
770
|
-
const tokenPathArg = args[0];
|
|
766
|
+
const tokenPathArg = node.getArguments()[0];
|
|
771
767
|
const tokenPath = tokenPathArg ? literalStringOf(tokenPathArg, stack, ctx) : void 0;
|
|
772
768
|
if (tokenPath !== void 0) {
|
|
773
|
-
const
|
|
774
|
-
const fallbackValue = fallbackArg ? literalStringOf(fallbackArg, stack, ctx) : void 0;
|
|
775
|
-
const resolvedValue = isValueMethod ? ctx.tokens.view.get(tokenPath, fallbackValue) : ctx.tokens.view.getVar(tokenPath, fallbackValue);
|
|
769
|
+
const resolvedValue = isValueMethod ? ctx.tokens.view.get(tokenPath) : ctx.tokens.view.getVar(tokenPath);
|
|
776
770
|
if (resolvedValue) return cache(box.literal(resolvedValue, node, stack));
|
|
777
771
|
}
|
|
778
772
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -757,21 +757,15 @@ function maybeBoxNode(node, stack, ctx, matchProp) {
|
|
|
757
757
|
let fnName = "";
|
|
758
758
|
let isValueMethod = false;
|
|
759
759
|
if (Node.isIdentifier(expr)) fnName = expr.getText();
|
|
760
|
-
else if (Node.isPropertyAccessExpression(expr)) {
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
fnName = expr.getExpression().getText();
|
|
765
|
-
} else fnName = expr.getText();
|
|
766
|
-
}
|
|
760
|
+
else if (Node.isPropertyAccessExpression(expr)) if (expr.getName() === "value") {
|
|
761
|
+
isValueMethod = true;
|
|
762
|
+
fnName = expr.getExpression().getText();
|
|
763
|
+
} else fnName = expr.getText();
|
|
767
764
|
if (ctx.tokens.isTokenFn ? ctx.tokens.isTokenFn(fnName) : fnName === "token") {
|
|
768
|
-
const
|
|
769
|
-
const tokenPathArg = args[0];
|
|
765
|
+
const tokenPathArg = node.getArguments()[0];
|
|
770
766
|
const tokenPath = tokenPathArg ? literalStringOf(tokenPathArg, stack, ctx) : void 0;
|
|
771
767
|
if (tokenPath !== void 0) {
|
|
772
|
-
const
|
|
773
|
-
const fallbackValue = fallbackArg ? literalStringOf(fallbackArg, stack, ctx) : void 0;
|
|
774
|
-
const resolvedValue = isValueMethod ? ctx.tokens.view.get(tokenPath, fallbackValue) : ctx.tokens.view.getVar(tokenPath, fallbackValue);
|
|
768
|
+
const resolvedValue = isValueMethod ? ctx.tokens.view.get(tokenPath) : ctx.tokens.view.getVar(tokenPath);
|
|
775
769
|
if (resolvedValue) return cache(box.literal(resolvedValue, node, stack));
|
|
776
770
|
}
|
|
777
771
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bamboocss/extractor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.30.0",
|
|
4
4
|
"description": "The css extractor for css bamboo",
|
|
5
5
|
"homepage": "https://bamboocss.com",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"ts-evaluator": "2.0.0",
|
|
37
37
|
"ts-morph": "28.0.0",
|
|
38
|
-
"@bamboocss/shared": "1.
|
|
38
|
+
"@bamboocss/shared": "1.30.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsdown src/index.ts --format=cjs,esm --shims --dts",
|