(input: string)
| 111 | * @since 4.1.2 |
| 112 | */ |
| 113 | export const parse = (input: string): Result.Result<unknown, EncodingError> => { |
| 114 | try { |
| 115 | return Result.succeed(parseUnsafe(input)) |
| 116 | } catch (e) { |
| 117 | return Result.fail( |
| 118 | new EncodingError({ |
| 119 | module: "Jsonc", |
| 120 | kind: "Decode", |
| 121 | input, |
| 122 | message: e instanceof Error ? e.message : "Invalid input" |
| 123 | }) |
| 124 | ) |
| 125 | } |
| 126 | } |
nothing calls this directly
no test coverage detected