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

Function parse

packages/effect/src/encoding/Jsonc.ts:113–126  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

111 * @since 4.1.2
112 */
113export 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}

Callers

nothing calls this directly

Calls 3

parseUnsafeFunction · 0.70
failMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected