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

Function parseOptionalJsonObject

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

Source from the content-addressed store, hash-verified

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

Callers 1

main.tsFile · 0.85

Calls 1

parseJsonObjectInputFunction · 0.90

Tested by

no test coverage detected