File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1935,7 +1935,7 @@ const TESTS: Test[] = [
19351935 [ [ undefined , "/(testing)" ] ] ,
19361936 ] ,
19371937 [
1938- "/.\\+\\*\\?\\{\\}=^!\\:$[]|" ,
1938+ "/.\\+\\*\\?\\{\\}=^\\ !\\:$[]\\ |" ,
19391939 undefined ,
19401940 [ "/.+*?{}=^!:$[]|" ] ,
19411941 [ [ "/.+*?{}=^!:$[]|" , [ "/.+*?{}=^!:$[]|" ] ] ] ,
Original file line number Diff line number Diff line change @@ -90,6 +90,7 @@ interface LexToken {
9090 | "CHAR"
9191 | "ESCAPED_CHAR"
9292 | "MODIFIER"
93+ | "RESERVED"
9394 | "END" ;
9495 index : number ;
9596 value : string ;
@@ -106,6 +107,11 @@ function lexer(str: string) {
106107 while ( i < chars . length ) {
107108 const char = chars [ i ] ;
108109
110+ if ( char === "!" || char === ";" || char === "|" ) {
111+ tokens . push ( { type : "RESERVED" , index : i , value : chars [ i ++ ] } ) ;
112+ continue ;
113+ }
114+
109115 if ( char === "*" || char === "+" || char === "?" ) {
110116 tokens . push ( { type : "MODIFIER" , index : i , value : chars [ i ++ ] } ) ;
111117 continue ;
@@ -510,6 +516,7 @@ function matchRegexp<P extends ParamData>(
510516) : MatchFunction < P > {
511517 const { decode = decodeURIComponent , loose = DEFAULT_DELIMITER } = options ;
512518 const stringify = toStringify ( loose ) ;
519+
513520 const decoders = keys . map ( ( key ) => {
514521 if ( key . separator ) {
515522 const re = new RegExp (
You can’t perform that action at this time.
0 commit comments