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

Function wrapPropertyKeyIssue

packages/effect/src/SchemaAST.ts:2583–2612  ·  view source on GitHub ↗
(
  s: {
    readonly input: unknown
    readonly options: ParseOptions
    issues: Array<SchemaIssue.Issue> | undefined
  },
  ast: AST,
  key: PropertyKey,
  exit: Exit.Failure<any, SchemaIssue.Issue>
)

Source from the content-addressed store, hash-verified

2581const parseArrayConcurrent = iterateConcurrent<ArrayParserState, unknown>()(parseArrayOptions)
2582
2583const wrapPropertyKeyIssue = (
2584 s: {
2585 readonly input: unknown
2586 readonly options: ParseOptions
2587 issues: Array<SchemaIssue.Issue> | undefined
2588 },
2589 ast: AST,
2590 key: PropertyKey,
2591 exit: Exit.Failure<any, SchemaIssue.Issue>
2592) => {
2593 if (exit.cause.reasons.length === 0) {
2594 return exit
2595 }
2596 const issue = InternalSchemaCause.getSchemaIssue(exit.cause)
2597 if (issue === undefined) {
2598 return Exit.failCause(
2599 Cause.map(
2600 exit.cause,
2601 (issue) =>
2602 new SchemaIssue.Composite(
2603 ast,
2604 [new SchemaIssue.Pointer([key], issue)],
2605 s.input,
2606 s.options
2607 )
2608 )
2609 )
2610 }
2611 return addIssue(s, ast, new SchemaIssue.Pointer([key], issue))
2612}
2613
2614// Keeps `issue` when the parse collects every error. Otherwise returns the
2615// failure that ends the parse.

Callers 4

stepArrayFunction · 0.85
finishIndexMethod · 0.85
parseIndexMethod · 0.85
stepPropertyFunction · 0.85

Calls 2

addIssueFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected