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

Function parse

packages/effect/src/encoding/Json5.ts:46–59  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

44 * @since 4.1.2
45 */
46export const parse = (input: string): Result.Result<unknown, EncodingError> => {
47 try {
48 return Result.succeed(internal.parse(input, "JSON5"))
49 } catch (e) {
50 return Result.fail(
51 new EncodingError({
52 module: "Json5",
53 kind: "Decode",
54 input,
55 message: e instanceof Error ? e.message : "Invalid input"
56 })
57 )
58 }
59}

Callers

nothing calls this directly

Calls 3

failMethod · 0.65
succeedMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected