MCPcopy
hub / github.com/deepstreamIO/deepstream.io / parseData

Function parseData

test-e2e/framework/utils.ts:3–14  ·  view source on GitHub ↗
(data: string)

Source from the content-addressed store, hash-verified

1export const defaultDelay: number = Number(process.env.DEFAULT_DELAY) || 10
2
3export const parseData = (data: string) => {
4 if (data === undefined || data === 'undefined') {
5 return undefined
6 } else if (data === 'null') {
7 return null
8 }
9 try {
10 return JSON.parse(data)
11 } catch (e) {
12 return data
13 }
14}

Callers 3

receivedFunction · 0.90
publishesFunction · 0.90
http-steps.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected