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

Function parseOptionalJsonObject

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

Source from the content-addressed store, hash-verified

1576};
1577
1578const parseOptionalJsonObject = (
1579 raw: string | undefined,
1580): Effect.Effect<Record<string, unknown> | undefined, Error> =>
1581 raw === undefined
1582 ? Effect.succeed(undefined)
1583 : parseJsonObjectInput(raw).pipe(
1584 Effect.mapError((error) => new Error(`Invalid --content JSON: ${error.message}`)),
1585 );
1586
1587const ownMessage = (value: unknown): string => {
1588 if (typeof value === "string") return value.trim();

Callers 1

main.tsFile · 0.85

Calls 1

parseJsonObjectInputFunction · 0.90

Tested by

no test coverage detected