chore: type [ci skip]
This commit is contained in:
@@ -64,7 +64,7 @@ const bar = 1
|
||||
`)
|
||||
// should generate working code
|
||||
assertCode(content)
|
||||
// should anayze bindings
|
||||
// should analyze bindings
|
||||
expect(bindings).toStrictEqual({
|
||||
foo: BindingTypes.PROPS,
|
||||
bar: BindingTypes.SETUP_CONST,
|
||||
@@ -403,7 +403,7 @@ defineExpose({ foo: 123 })
|
||||
assertCode(content)
|
||||
})
|
||||
|
||||
// #4340 interpolations in tempalte strings
|
||||
// #4340 interpolations in template strings
|
||||
test('js template string interpolations', () => {
|
||||
const { content } = compile(`
|
||||
<script setup lang="ts">
|
||||
|
||||
@@ -33,7 +33,7 @@ function genVarName(id: string, raw: string, isProd: boolean): string {
|
||||
}
|
||||
}
|
||||
|
||||
function noramlizeExpression(exp: string) {
|
||||
function normalizeExpression(exp: string) {
|
||||
exp = exp.trim()
|
||||
if (
|
||||
(exp[0] === `'` && exp[exp.length - 1] === `'`) ||
|
||||
@@ -51,7 +51,7 @@ export function parseCssVars(sfc: SFCDescriptor): string[] {
|
||||
// ignore v-bind() in comments /* ... */
|
||||
const content = style.content.replace(/\/\*([\s\S]*?)\*\//g, '')
|
||||
while ((match = cssVarRE.exec(content))) {
|
||||
const variable = noramlizeExpression(match[1])
|
||||
const variable = normalizeExpression(match[1])
|
||||
if (!vars.includes(variable)) {
|
||||
vars.push(variable)
|
||||
}
|
||||
@@ -74,7 +74,7 @@ export const cssVarsPlugin: PluginCreator<CssVarsPluginOptions> = opts => {
|
||||
// rewrite CSS variables
|
||||
if (cssVarRE.test(decl.value)) {
|
||||
decl.value = decl.value.replace(cssVarRE, (_, $1) => {
|
||||
return `var(--${genVarName(id, noramlizeExpression($1), isProd)})`
|
||||
return `var(--${genVarName(id, normalizeExpression($1), isProd)})`
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user