File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1935,7 +1935,7 @@ const TESTS: Test[] = [
1935
1935
[ [ undefined , "/(testing)" ] ] ,
1936
1936
] ,
1937
1937
[
1938
- "/.\\+\\*\\?\\{\\}=^!\\:$[]|" ,
1938
+ "/.\\+\\*\\?\\{\\}=^\\ !\\:$[]\\ |" ,
1939
1939
undefined ,
1940
1940
[ "/.+*?{}=^!:$[]|" ] ,
1941
1941
[ [ "/.+*?{}=^!:$[]|" , [ "/.+*?{}=^!:$[]|" ] ] ] ,
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ interface LexToken {
90
90
| "CHAR"
91
91
| "ESCAPED_CHAR"
92
92
| "MODIFIER"
93
+ | "RESERVED"
93
94
| "END" ;
94
95
index : number ;
95
96
value : string ;
@@ -106,6 +107,11 @@ function lexer(str: string) {
106
107
while ( i < chars . length ) {
107
108
const char = chars [ i ] ;
108
109
110
+ if ( char === "!" || char === ";" || char === "|" ) {
111
+ tokens . push ( { type : "RESERVED" , index : i , value : chars [ i ++ ] } ) ;
112
+ continue ;
113
+ }
114
+
109
115
if ( char === "*" || char === "+" || char === "?" ) {
110
116
tokens . push ( { type : "MODIFIER" , index : i , value : chars [ i ++ ] } ) ;
111
117
continue ;
@@ -510,6 +516,7 @@ function matchRegexp<P extends ParamData>(
510
516
) : MatchFunction < P > {
511
517
const { decode = decodeURIComponent , loose = DEFAULT_DELIMITER } = options ;
512
518
const stringify = toStringify ( loose ) ;
519
+
513
520
const decoders = keys . map ( ( key ) => {
514
521
if ( key . separator ) {
515
522
const re = new RegExp (
You can’t perform that action at this time.
0 commit comments