mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +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)
|
||||
|
||||
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}`
|
||||
|
||||
Reference in New Issue
Block a user