Skip to content

Commit

Permalink
fix(vscode): don't crash on unmatched values
Browse files Browse the repository at this point in the history
  • Loading branch information
sibbng committed Feb 17, 2023
1 parent c443835 commit cfe92aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared-common/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export function getMatchedPositions(code: string, matched: string[], hasVariantG
const escaped = match[1]
const body = match[0].slice(escaped.length)
let bodyIndex = body.match(`[\\b\\s'"]${escapeRegExp(value)}[\\b\\s'"]`)?.index ?? -1
if (body[bodyIndex].match(/[\s'"]/))
if (body[bodyIndex]?.match(/[\s'"]/))
bodyIndex++
if (bodyIndex < 0)
return
Expand Down

0 comments on commit cfe92aa

Please sign in to comment.