@@ -181,26 +181,26 @@ describe('experimental: type-level RegExp match for type safe match results', ()
181
181
]
182
182
` )
183
183
expectTypeOf ( matchResult ?. _matchArray ) . toEqualTypeOf <
184
- [ 'bazqux' , 'bazqux' , 'baz' ] | [ ' barqux', 'barqux' , 'bar' ] | undefined
184
+ [ 'barqux' , 'barqux' , 'bar' ]
185
185
> ( )
186
186
187
187
expect ( matchResult ?. [ 0 ] ) . toMatchInlineSnapshot ( '"barqux"' )
188
- expectTypeOf ( matchResult ?. [ 0 ] ) . toEqualTypeOf < 'bazqux' | ' barqux' | undefined > ( )
188
+ expectTypeOf ( matchResult ?. [ 0 ] ) . toEqualTypeOf < 'barqux' > ( )
189
189
190
190
expect ( matchResult ?. [ 1 ] ) . toMatchInlineSnapshot ( '"barqux"' )
191
- expectTypeOf ( matchResult ?. [ 1 ] ) . toEqualTypeOf < 'bazqux' | ' barqux' | undefined > ( )
191
+ expectTypeOf ( matchResult ?. [ 1 ] ) . toEqualTypeOf < 'barqux' > ( )
192
192
193
193
expect ( matchResult ?. [ 2 ] ) . toMatchInlineSnapshot ( '"bar"' )
194
- expectTypeOf ( matchResult ?. [ 2 ] ) . toEqualTypeOf < 'bar' | 'baz' | undefined > ( )
194
+ expectTypeOf ( matchResult ?. [ 2 ] ) . toEqualTypeOf < 'bar' > ( )
195
195
196
196
// @ts -expect-error - Element implicitly has an 'any' type because expression of type '3' can't be used to index
197
197
expect ( matchResult ?. [ 3 ] ) . toMatchInlineSnapshot ( 'undefined' )
198
198
199
199
expect ( matchResult ?. index ) . toMatchInlineSnapshot ( '1' )
200
- expectTypeOf ( matchResult ?. index ) . toEqualTypeOf < number | undefined > ( )
200
+ expectTypeOf ( matchResult ?. index ) . toEqualTypeOf < 1 > ( )
201
201
202
202
expect ( matchResult ?. length ) . toMatchInlineSnapshot ( '3' )
203
- expectTypeOf ( matchResult ?. length ) . toEqualTypeOf < 3 | undefined > ( )
203
+ expectTypeOf ( matchResult ?. length ) . toEqualTypeOf < 3 > ( )
204
204
205
205
expect ( matchResult ?. groups ) . toMatchInlineSnapshot ( `
206
206
{
@@ -209,7 +209,7 @@ describe('experimental: type-level RegExp match for type safe match results', ()
209
209
}
210
210
` )
211
211
expectTypeOf ( matchResult ?. groups ) . toEqualTypeOf <
212
- { g1 : 'bar' | 'baz' , g2 : 'bazqux' | ' barqux' } | undefined
212
+ { g1 : 'bar' , g2 : 'barqux' }
213
213
> ( )
214
214
} )
215
215
} )
0 commit comments