feat: patch again

This commit is contained in:
Dunqing 2023-09-13 18:36:34 +08:00
parent f241905397
commit 584e8b7929
2 changed files with 11 additions and 12 deletions

View File

@ -1,18 +1,17 @@
diff --git a/dist/index.js b/dist/index.js
index 8b8e0d078e27474da1cf58ce3fef1d7acefb1cd4..ebf812a6a06dec6e7367233db773cd03f03db90e 100644
index 8b8e0d078e27474da1cf58ce3fef1d7acefb1cd4..0753137ff48b7d34338db98c3568c82e9798b3b7 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -146,7 +146,12 @@ async function removeTypesFromVueSfcScript(code, fileName, script, templateAst,
@@ -146,9 +146,10 @@ async function removeTypesFromVueSfcScript(code, fileName, script, templateAst,
(0, import_template_ast_types.traverse)(templateAst, {
enter(node) {
if ((0, import_template_ast_types.isSimpleExpressionNode)(node) && !node.isStatic) {
- expressions.add(node.content);
+ const content = node.content.trim();
+ if (content.startsWith("{") && content.endsWith("}")) {
+ expressions.add(`[${content}]`);
+ } else {
+ expressions.add(content);
+ }
} else if ((0, import_template_ast_types.isComponentNode)(node)) {
expressions.add(node.tag);
- expressions.add(node.tag);
+ expressions.add(`[${node.tag}]`);
}
}
});

View File

@ -6,7 +6,7 @@ settings:
patchedDependencies:
detype@0.6.3:
hash: g5z5gyssezsozt6u6tz5kefv34
hash: 6ktqwatz2smalcxwhreeceligi
path: patches/detype@0.6.3.patch
importers:
@ -245,7 +245,7 @@ importers:
version: 0.34.3(vitest@0.34.3)
detype:
specifier: ^0.6.3
version: 0.6.3(patch_hash=g5z5gyssezsozt6u6tz5kefv34)
version: 0.6.3(patch_hash=6ktqwatz2smalcxwhreeceligi)
tsup:
specifier: ^7.2.0
version: 7.2.0(ts-node@10.9.1)(typescript@5.2.2)
@ -3978,7 +3978,7 @@ packages:
resolution: {integrity: sha512-M1Ob1zPSIvlARiJUkKqvAZ3VAqQY6Jcuth/pBKQ2b1dX/Qx0OnJ8Vux6J2H5PTMQeRzWrrbTu70VxBfv/OPDJA==}
dev: false
/detype@0.6.3(patch_hash=g5z5gyssezsozt6u6tz5kefv34):
/detype@0.6.3(patch_hash=6ktqwatz2smalcxwhreeceligi):
resolution: {integrity: sha512-b42ytoZGAOo2U9V4zAMqtiWHgeG8F6kRQsg1E6n0uARMxOItxlWWS+pSsNbvmejInhfui0Q0mn9Bd4lwqhLaSA==}
engines: {node: '>=14.19.3'}
hasBin: true