mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 07:05:11 +00:00
perf(vite): avoid endsWith
when checking for whitespace (#24746)
This commit is contained in:
parent
b5853c977e
commit
860cfe16b3
@ -119,7 +119,8 @@ export const composableKeysPlugin = createUnplugin((options: ComposableKeysOptio
|
||||
}
|
||||
|
||||
// TODO: Optimize me (https://github.com/nuxt/framework/pull/8529)
|
||||
const endsWithComma = code.slice(codeIndex + (node as any).start, codeIndex + (node as any).end - 1).trim().endsWith(',')
|
||||
const newCode = code.slice(codeIndex + (node as any).start, codeIndex + (node as any).end - 1).trim()
|
||||
const endsWithComma = newCode[newCode.length - 1] === ','
|
||||
|
||||
s.appendLeft(
|
||||
codeIndex + (node as any).end - 1,
|
||||
|
Loading…
Reference in New Issue
Block a user