( predicate: predicate )
| 644 | predicate: (input: input) => input is narrowed |
| 645 | ): GuardExcludeP<input, narrowed, excluded>; |
| 646 | export function when<input, predicate extends (value: input) => unknown>( |
| 647 | predicate: predicate |
| 648 | ): GuardP< |
| 649 | input, |
| 650 | predicate extends (value: any) => value is infer narrowed ? narrowed : never |
| 651 | > { |
| 652 | return { |
| 653 | [matcher]: () => ({ |
| 654 | match: <UnknownInput>(value: UnknownInput | input) => ({ |
| 655 | matched: Boolean(predicate(value as input)), |
| 656 | }), |
| 657 | }), |
| 658 | }; |
| 659 | } |
| 660 | |
| 661 | /** |
| 662 | * `P.select()` is a pattern which will always match, |
no outgoing calls
no test coverage detected
searching dependent graphs…