MCPcopy Create free account
hub / github.com/middleapi/orpc / parseEmptyableJSON

Function parseEmptyableJSON

packages/shared/src/json.ts:1–7  ·  view source on GitHub ↗
(text: string | null | undefined)

Source from the content-addressed store, hash-verified

1export function parseEmptyableJSON(text: string | null | undefined): unknown {
2 if (!text) {
3 return undefined
4 }
5
6 return JSON.parse(text)
7}
8
9export function stringifyJSON<T>(value: T | { toJSON(): T }): undefined extends T ? undefined | string : string {
10 // eslint-disable-next-line ban/ban

Callers 11

serializeAndDeserializeFunction · 0.90
toEventIteratorFunction · 0.90
toStandardBodyFunction · 0.90
toStandardBodyFunction · 0.90
parseBatchRequestFunction · 0.90
getMethod · 0.90
toStandardBodyFunction · 0.90
json.test.tsFile · 0.90
decodeMethod · 0.90

Calls

no outgoing calls

Tested by 1

serializeAndDeserializeFunction · 0.72