mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-02-01 12:47:57 +01:00
fix(templates): handle - in regexp
This commit is contained in:
@@ -56,7 +56,7 @@ export default function createTemplates (options: ModuleOptions, nuxt: Nuxt) {
|
|||||||
let json = JSON.stringify(result, null, 2)
|
let json = JSON.stringify(result, null, 2)
|
||||||
|
|
||||||
for (const variant of variants) {
|
for (const variant of variants) {
|
||||||
json = json.replaceAll(new RegExp(`("${variant}": "[0-9a-z]+")`, 'g'), '$1 as const')
|
json = json.replaceAll(new RegExp(`("${variant}": "[0-9a-z-]+")`, 'g'), '$1 as const')
|
||||||
}
|
}
|
||||||
|
|
||||||
return `export default ${json}`
|
return `export default ${json}`
|
||||||
|
|||||||
Reference in New Issue
Block a user