commit
cdf3f9dd6f
|
@ -4,7 +4,7 @@ const isEmpty = (value: any) => value === '';
|
|||
const makeRegexp = (reg: string | RegExp) => {
|
||||
if (reg instanceof RegExp) {
|
||||
return reg;
|
||||
} else if (/^\/(.+)\/([gimuy]*)$/.test(reg)) {
|
||||
} else if (/^(?:matchRegexp\:)?\/(.+)\/([gimuy]*)$/.test(reg)) {
|
||||
return new RegExp(RegExp.$1, RegExp.$2 || '');
|
||||
} else if (typeof reg === 'string') {
|
||||
return new RegExp(reg);
|
||||
|
|
Loading…
Reference in New Issue