Function
parseInteger
(
s: string,
ctx: Traversal,
says?: Says
)
Source from the content-addressed store, hash-verified
| 30 | ) |
| 31 | |
| 32 | export const parseInteger = ( |
| 33 | s: string, |
| 34 | ctx: Traversal, |
| 35 | says?: Says |
| 36 | ): number | ArkError => { |
| 37 | const parsed = Number.parseInt(s) |
| 38 | return Number.isSafeInteger(parsed) ? parsed : ( |
| 39 | ctx.error({ ...integerParseError, ...says }) |
| 40 | ) |
| 41 | } |
| 42 | |
| 43 | export const parseBoolean = (s: "true" | "false"): boolean => s === "true" |
| 44 | |
Callers
nothing calls this directly
Tested by
no test coverage detected