mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +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)
|
// 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(
|
s.appendLeft(
|
||||||
codeIndex + (node as any).end - 1,
|
codeIndex + (node as any).end - 1,
|
||||||
|
Loading…
Reference in New Issue
Block a user