(
predicate: (
a: A,
options: ParseOptions,
self: AST.Refinement
) => FilterReturnType,
annotations?: Annotations.Filter<A>
)
| 3709 | annotations?: Annotations.Filter<Types.NoInfer<Schema.Type<S>>> |
| 3710 | ): (self: S) => filter<S> |
| 3711 | export function filter<A>( |
| 3712 | predicate: ( |
| 3713 | a: A, |
| 3714 | options: ParseOptions, |
| 3715 | self: AST.Refinement |
| 3716 | ) => FilterReturnType, |
| 3717 | annotations?: Annotations.Filter<A> |
| 3718 | ): <I, R>(self: Schema<A, I, R>) => refine<A, Schema<A, I, R>> { |
| 3719 | return <I, R>(self: Schema<A, I, R>) => { |
| 3720 | function filter(input: A, options: AST.ParseOptions, ast: AST.Refinement) { |
| 3721 | return toFilterParseIssue(predicate(input, options, ast), ast, input) |
| 3722 | } |
| 3723 | const ast = new AST.Refinement( |
| 3724 | self.ast, |
| 3725 | filter, |
| 3726 | toASTAnnotations(annotations) |
| 3727 | ) |
| 3728 | return makeRefineClass(self, filter, ast) |
| 3729 | } |
| 3730 | } |
| 3731 | |
| 3732 | /** |
| 3733 | * @category api interface |
no test coverage detected