MCPcopy Create free account
hub / github.com/Effect-TS/effect / normalizeFilterOutput

Function normalizeFilterOutput

packages/effect/src/SchemaIssue.ts:826–841  ·  view source on GitHub ↗
(
  ast: SchemaAST.AST,
  out: Schema.FilterOutput,
  input?: unknown,
  options?: SchemaAST.ParseOptions
)

Source from the content-addressed store, hash-verified

824
825/** @internal */
826export function normalizeFilterOutput(
827 ast: SchemaAST.AST,
828 out: Schema.FilterOutput,
829 input?: unknown,
830 options?: SchemaAST.ParseOptions
831): Issue | undefined {
832 if (Array.isArray(out)) {
833 if (!Arr.isReadonlyArrayNonEmpty(out)) {
834 return undefined
835 }
836 return out.length === 1
837 ? makeFilterIssue(out[0], input, options)
838 : new Composite(ast, Arr.map(out, (entry) => makeFilterIssue(entry, input, options)), input, options)
839 }
840 return makeSingle(out as undefined | boolean | Schema.FilterIssue, input, options)
841}
842
843/**
844 * A function type that converts an {@link Issue} into a formatted

Callers

nothing calls this directly

Calls 3

makeFilterIssueFunction · 0.85
makeSingleFunction · 0.70
mapMethod · 0.45

Tested by

no test coverage detected