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

Function addIssue

packages/effect/src/SchemaAST.ts:2616–2630  ·  view source on GitHub ↗
(
  s: {
    readonly input: unknown
    readonly options: ParseOptions
    issues: Array<SchemaIssue.Issue> | undefined
  },
  ast: AST,
  issue: SchemaIssue.Issue
)

Source from the content-addressed store, hash-verified

2614// Keeps `issue` when the parse collects every error. Otherwise returns the
2615// failure that ends the parse.
2616const addIssue = (
2617 s: {
2618 readonly input: unknown
2619 readonly options: ParseOptions
2620 issues: Array<SchemaIssue.Issue> | undefined
2621 },
2622 ast: AST,
2623 issue: SchemaIssue.Issue
2624): Exit.Exit<never, SchemaIssue.Issue> | undefined => {
2625 if (s.options.errors !== "all") {
2626 return Exit.fail(new SchemaIssue.Composite(ast, [issue], s.input, s.options))
2627 }
2628 if (s.issues) s.issues.push(issue)
2629 else s.issues = [issue]
2630}
2631
2632/**
2633 * floating point or integer, with optional exponent

Callers 5

finishMethod · 0.85
stepArrayFunction · 0.85
wrapPropertyKeyIssueFunction · 0.85
makeFallbackMethod · 0.85
stepPropertyFunction · 0.85

Calls 2

failMethod · 0.65
pushMethod · 0.65

Tested by

no test coverage detected