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

Function parse

packages/effect/src/encoding/Toml.ts:568–581  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

566 * @since 4.0.0
567 */
568export const parse = (input: string): Result.Result<Record<string, unknown>, EncodingError> => {
569 try {
570 return Result.succeed(new TomlParser(input.replace(/^\uFEFF/, "")).parse())
571 } catch (e) {
572 return Result.fail(
573 new EncodingError({
574 module: "Toml",
575 kind: "Decode",
576 input,
577 message: e instanceof Error ? e.message : "Invalid input"
578 })
579 )
580 }
581}

Callers

nothing calls this directly

Calls 4

failMethod · 0.65
succeedMethod · 0.45
parseMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected