MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / parseOptionalJsonObject

Function parseOptionalJsonObject

apps/cli/src/main.ts:1514–1521  ·  view source on GitHub ↗
(
  raw: string | undefined,
)

Source from the content-addressed store, hash-verified

1512};
1513
1514const parseOptionalJsonObject = (
1515 raw: string | undefined,
1516): Effect.Effect<Record<string, unknown> | undefined, Error> =>
1517 raw === undefined
1518 ? Effect.succeed(undefined)
1519 : parseJsonObjectInput(raw).pipe(
1520 Effect.mapError((error) => new Error(`Invalid --content JSON: ${error.message}`)),
1521 );
1522
1523const formatUnknownMessage = (cause: unknown): string => {
1524 if (cause instanceof Error) return cause.message;

Callers 1

main.tsFile · 0.85

Calls 1

parseJsonObjectInputFunction · 0.90

Tested by

no test coverage detected