MCPcopy
hub / github.com/Effect-TS/effect / filter

Function filter

packages/effect/src/Schema.ts:3711–3730  ·  view source on GitHub ↗
(
  predicate: (
    a: A,
    options: ParseOptions,
    self: AST.Refinement
  ) => FilterReturnType,
  annotations?: Annotations.Filter<A>
)

Source from the content-addressed store, hash-verified

3709 annotations?: Annotations.Filter<Types.NoInfer<Schema.Type<S>>>
3710): (self: S) => filter<S>
3711export 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

Callers 15

trimmedFunction · 0.70
maxLengthFunction · 0.70
minLengthFunction · 0.70
lengthFunction · 0.70
patternFunction · 0.70
startsWithFunction · 0.70
endsWithFunction · 0.70
includesFunction · 0.70
lowercasedFunction · 0.70
uppercasedFunction · 0.70
capitalizedFunction · 0.70
uncapitalizedFunction · 0.70

Calls 4

toFilterParseIssueFunction · 0.85
toASTAnnotationsFunction · 0.85
makeRefineClassFunction · 0.85
predicateFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…