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

Function parseOptionalJsonObject

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

Source from the content-addressed store, hash-verified

1489};
1490
1491const parseOptionalJsonObject = (
1492 raw: string | undefined,
1493): Effect.Effect<Record<string, unknown> | undefined, Error> =>
1494 raw === undefined
1495 ? Effect.succeed(undefined)
1496 : parseJsonObjectInput(raw).pipe(
1497 Effect.mapError((error) => new Error(`Invalid --content JSON: ${error.message}`)),
1498 );
1499
1500const formatUnknownMessage = (cause: unknown): string => {
1501 if (cause instanceof Error) return cause.message;

Callers 1

main.tsFile · 0.85

Calls 1

parseJsonObjectInputFunction · 0.90

Tested by

no test coverage detected