We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32c9628 commit 50e7047Copy full SHA for 50e7047
src/module.ts
@@ -46,14 +46,12 @@ export default defineNuxtModule<ModuleOptions>({
46
47
functionBody.push(` if(to.name === ${JSON.stringify(page.name)}) {`)
48
49
- // open to suggestion to fix this one
50
- // eslint-disable-next-line regexp/no-super-linear-backtracking
51
- for (const match of page.file.matchAll(/\[(?<pv>\S+?=\S+?)\]/g)) {
+ for (const match of page.file.matchAll(/\[(?<param>[^\s=]+)=(?<validator>\S+?)\]/g)) {
52
if (!match.groups) {
53
continue
54
}
55
56
- const [param, validator] = match.groups.pv.split('=')
+ const { param, validator } = match.groups
57
58
page.path = page.path.replace(`:${param}${validator}`, `:${param}`)
59
0 commit comments