shadcn-vue/patches/vue-eslint-parser@9.4.3.patch
zernonia f8f3fc754f
feat: support tailwind prefix (#619)
* chore: enable tw prefix

* chore: enable tw  prefix during init

* fix: cater for cn function

* fix: prevent transforming importDeclaration

* chore: update registry to make sure tailwind prefix parse correctly

* chore: fix wrong import

* chore: checkpoint

* refactor: goodbye ts-morph

* chore: remove ts-morpg

* chore: update test

* chore: cleanup

* chore: fix test

* fix: move vue-metamorph to dep

* refactor: transform tw prefix by specific case

* fix: transform-sfc not parsing .ts file

* fix: prefix double quote

* chore: patch vue-eslint-parser

* refactor: transform to cater only for class in sfc

* refactor: replace detypes with @unovue/detypes

* chore: update test snapshot

* chore: update pnpm-lock, fix import

* chore: bump detypes version

* chore: update deps
2024-10-14 19:39:58 +08:00

16 lines
602 B
Diff

diff --git a/index.js b/index.js
index ead6e607e8bd14e0053269a8a330bd1cf67a5897..b6b304343e0e6427531e2068e50eb45e4fb91109 100644
--- a/index.js
+++ b/index.js
@@ -692,8 +692,8 @@ function extractGeneric(element) {
function getConstraint(node, rawParam) {
if (!node.constraint) {
return "unknown";
- }
- let index = rawParam.indexOf(node.name.name) + node.name.name.length;
+ }
+ let index = rawParam.indexOf(node.name.name) + (node.name.name?.length ?? node.name.length);
let startIndex = null;
while (index < rawParam.length) {
if (startIndex == null) {