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

Function parseOptionalJsonObject

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

Source from the content-addressed store, hash-verified

1553};
1554
1555const parseOptionalJsonObject = (
1556 raw: string | undefined,
1557): Effect.Effect<Record<string, unknown> | undefined, Error> =>
1558 raw === undefined
1559 ? Effect.succeed(undefined)
1560 : parseJsonObjectInput(raw).pipe(
1561 Effect.mapError((error) => new Error(`Invalid --content JSON: ${error.message}`)),
1562 );
1563
1564const ownMessage = (value: unknown): string => {
1565 if (typeof value === "string") return value.trim();

Callers 1

main.tsFile · 0.85

Calls 1

parseJsonObjectInputFunction · 0.90

Tested by

no test coverage detected