( pattern: P, f: Fn )
| 261 | |
| 262 | /** @internal */ |
| 263 | export const when = < |
| 264 | R, |
| 265 | const P extends Types.PatternPrimitive<R> | Types.PatternBase<R>, |
| 266 | Ret, |
| 267 | Fn extends (_: Types.WhenMatch<R, P>) => Ret |
| 268 | >( |
| 269 | pattern: P, |
| 270 | f: Fn |
| 271 | ) => |
| 272 | <I, F, A, Pr>( |
| 273 | self: Matcher<I, F, R, A, Pr, Ret> |
| 274 | ): Matcher< |
| 275 | I, |
| 276 | Types.AddWithout<F, Types.PForExclude<P>>, |
| 277 | Types.ApplyFilters<I, Types.AddWithout<F, Types.PForExclude<P>>>, |
| 278 | A | ReturnType<Fn>, |
| 279 | Pr, |
| 280 | Ret |
| 281 | > => (self as any).add(makeWhen(makePredicate(pattern), f as any)) |
| 282 | |
| 283 | /** @internal */ |
| 284 | export const whenOr = < |
no test coverage detected