MCPcopy
hub / github.com/opentrace/opentrace / safeJsonParse

Function safeJsonParse

ui/src/store/ladybugStore.ts:436–445  ·  view source on GitHub ↗

Safely parse a JSON string, returning fallback on error.

(
  s: string,
  fallback: Record<string, unknown> = {},
)

Source from the content-addressed store, hash-verified

434
435/** Safely parse a JSON string, returning fallback on error. */
436function safeJsonParse(
437 s: string,
438 fallback: Record<string, unknown> = {},
439): Record<string, unknown> {
440 try {
441 return JSON.parse(s) as Record<string, unknown>;
442 } catch {
443 return fallback;
444 }
445}
446
447/** Convert an array of row objects to Parquet bytes via Arrow IPC → parquet-wasm. */
448async function rowsToParquet(

Callers 1

importDatabaseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected