(
s: {
readonly input: unknown
readonly options: ParseOptions
issues: Array<SchemaIssue.Issue> | undefined
},
ast: AST,
issue: SchemaIssue.Issue
)
| 2614 | // Keeps `issue` when the parse collects every error. Otherwise returns the |
| 2615 | // failure that ends the parse. |
| 2616 | const 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 |
no test coverage detected