( validator: Validator, value: unknown, key: PropertyKey | null, defaultKey: DefaultKey )
| 1404 | |
| 1405 | // checked once per key, thrown in en as a ParseError |
| 1406 | export const checkDefault = ( |
| 1407 | validator: Validator, |
| 1408 | value: unknown, |
| 1409 | key: PropertyKey | null, |
| 1410 | defaultKey: DefaultKey |
| 1411 | ): void => { |
| 1412 | const checked = checkedDefaultOf(defaultKey) |
| 1413 | if (checked.value) return |
| 1414 | const out = validator.traverse(value) |
| 1415 | if (out instanceof ArkErrors) { |
| 1416 | if (key === null) throwParseError(`Default ${out.summary}`) |
| 1417 | const atPath = new ArkErrors() |
| 1418 | mergeIssues(atPath, out, [key]) |
| 1419 | throwParseError(`Default for ${atPath.summary}`) |
| 1420 | } |
| 1421 | checked.value = true |
| 1422 | } |
| 1423 | |
| 1424 | export const checkInput = ( |
| 1425 | value: unknown, |
nothing calls this directly
no test coverage detected