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<
154
154
and : Object . assign ( ( ...inputs : InputSource [ ] ) => createInput ( `${ s } ${ exactly ( ...inputs ) } ` ) , {
155
155
referenceTo : ( groupName : string ) => createInput ( `${ s } \\k<${ groupName } >` ) ,
156
156
} ) ,
157
- or : ( ...inputs ) => createInput ( `(?:${ s } |${ exactly ( ... inputs ) } )` ) ,
157
+ or : ( ...inputs ) => createInput ( `(?:${ s } |${ inputs . map ( v => exactly ( v ) ) . join ( '|' ) } )` ) ,
158
158
after : ( ...input ) => createInput ( `(?<=${ exactly ( ...input ) } )${ s } ` ) ,
159
159
before : ( ...input ) => createInput ( `${ s } (?=${ exactly ( ...input ) } )` ) ,
160
160
notAfter : ( ...input ) => createInput ( `(?<!${ exactly ( ...input ) } )${ s } ` ) ,
Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ describe('chained inputs', () => {
255
255
const multi = multichar . or ( 'foo' , input . groupedAs ( 'groupName' ) , exactly ( 'bar' ) . or ( test ) )
256
256
const regexp2 = new RegExp ( multi as any )
257
257
expect ( regexp2 ) . toMatchInlineSnapshot (
258
- '/\\(\\?:ab\\|foo\\(\\?<groupName>\\\\\\?\\)\\(\\?:bar\\|test\\\\\\.js\\)\\)/' ,
258
+ '/\\(\\?:ab\\|foo\\|\\ (\\?<groupName>\\\\\\?\\)\\| \\(\\?:bar\\|test\\\\\\.js\\)\\)/' ,
259
259
)
260
260
expectTypeOf (
261
261
extractRegExp ( multi ) ,
You can’t perform that action at this time.
0 commit comments