perf(nuxt): use .test
and hoist regexps where possible
#21011
Merged
.test
and hoist regexps where possible
#21011