chore: not match non-alphabetical characters

This commit is contained in:
Clark Du 2019-06-25 10:52:13 +01:00
parent 1a435ad32b
commit d009bdeb17
No known key found for this signature in database
GPG Key ID: D0E5986AF78B86D9
3 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ import glob from 'glob-all'
class TailwindExtractor {
static extract(content) {
return content.match(/[A-z0-9-:/]+/g) || []
return content.match(/[A-Za-z0-9-:/]+/g) || []
}
}

View File

@ -13,7 +13,7 @@ describe('dynamic routes', () => {
routerFile = routerFile
.slice(routerFile.indexOf('routes: ['))
.replace('routes: [', '[')
.replace(/ _[0-9A-z]+,/g, ' "",')
.replace(/ _[0-9A-Za-z]+,/g, ' "",')
routerFile = routerFile.substr(
routerFile.indexOf('['),
routerFile.lastIndexOf(']') + 1

View File

@ -13,7 +13,7 @@ describe('route-name-splitter', () => {
routerFile = routerFile
.slice(routerFile.indexOf('routes: ['))
.replace('routes: [', '[')
.replace(/ _[0-9A-z]+,/g, ' "",')
.replace(/ _[0-9A-Za-z]+,/g, ' "",')
routerFile = routerFile.substr(
routerFile.indexOf('['),
routerFile.lastIndexOf(']') + 1