( ...args: [...patterns: P, f: Fn] )
| 282 | |
| 283 | /** @internal */ |
| 284 | export const whenOr = < |
| 285 | R, |
| 286 | const P extends ReadonlyArray< |
| 287 | Types.PatternPrimitive<R> | Types.PatternBase<R> |
| 288 | >, |
| 289 | Ret, |
| 290 | Fn extends (_: Types.WhenMatch<R, P[number]>) => Ret |
| 291 | >( |
| 292 | ...args: [...patterns: P, f: Fn] |
| 293 | ) => |
| 294 | <I, F, A, Pr>( |
| 295 | self: Matcher<I, F, R, A, Pr, Ret> |
| 296 | ): Matcher< |
| 297 | I, |
| 298 | Types.AddWithout<F, Types.PForExclude<P[number]>>, |
| 299 | Types.ApplyFilters<I, Types.AddWithout<F, Types.PForExclude<P[number]>>>, |
| 300 | A | ReturnType<Fn>, |
| 301 | Pr, |
| 302 | Ret |
| 303 | > => { |
| 304 | const onMatch = args[args.length - 1] as any |
| 305 | const patterns = args.slice(0, -1) as unknown as P |
| 306 | return (self as any).add(makeWhen(makeOrPredicate(patterns), onMatch)) |
| 307 | } |
| 308 | |
| 309 | /** @internal */ |
| 310 | export const whenAnd = < |
nothing calls this directly
no test coverage detected