File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ export function createInput<
154154 and : Object . assign ( ( ...inputs : InputSource [ ] ) => createInput ( `${ s } ${ exactly ( ...inputs ) } ` ) , {
155155 referenceTo : ( groupName : string ) => createInput ( `${ s } \\k<${ groupName } >` ) ,
156156 } ) ,
157- or : ( ...inputs ) => createInput ( `(?:${ s } |${ exactly ( ... inputs ) } )` ) ,
157+ or : ( ...inputs ) => createInput ( `(?:${ s } |${ inputs . map ( v => exactly ( v ) ) . join ( '|' ) } )` ) ,
158158 after : ( ...input ) => createInput ( `(?<=${ exactly ( ...input ) } )${ s } ` ) ,
159159 before : ( ...input ) => createInput ( `${ s } (?=${ exactly ( ...input ) } )` ) ,
160160 notAfter : ( ...input ) => createInput ( `(?<!${ exactly ( ...input ) } )${ s } ` ) ,
Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ describe('chained inputs', () => {
255255 const multi = multichar . or ( 'foo' , input . groupedAs ( 'groupName' ) , exactly ( 'bar' ) . or ( test ) )
256256 const regexp2 = new RegExp ( multi as any )
257257 expect ( regexp2 ) . toMatchInlineSnapshot (
258- '/\\(\\?:ab\\|foo\\(\\?<groupName>\\\\\\?\\)\\(\\?:bar\\|test\\\\\\.js\\)\\)/' ,
258+ '/\\(\\?:ab\\|foo\\|\\ (\\?<groupName>\\\\\\?\\)\\| \\(\\?:bar\\|test\\\\\\.js\\)\\)/' ,
259259 )
260260 expectTypeOf (
261261 extractRegExp ( multi ) ,
You can’t perform that action at this time.
0 commit comments