MCPcopy Index your code
hub / github.com/vuejs/devtools-v6 / parseCircularAutoChunks

Function parseCircularAutoChunks

packages/shared-utils/src/transfer.ts:103–118  ·  view source on GitHub ↗
(data: any, reviver: (this: any, key: string, value: any) => any = null)

Source from the content-addressed store, hash-verified

101}
102
103export function parseCircularAutoChunks(data: any, reviver: (this: any, key: string, value: any) => any = null) {
104 if (Array.isArray(data)) {
105 data = data.join('')
106 }
107 const hasCircular = /^\s/.test(data)
108 if (!hasCircular) {
109 return arguments.length === 1
110 ? JSON.parse(data)
111 : JSON.parse(data, reviver)
112 }
113 else {
114 const list = JSON.parse(data)
115 decode(list, reviver)
116 return list[0]
117 }
118}
119
120export function stringifyStrictCircularAutoChunks(data: any, replacer: (this: any, key: string, value: any) => any = null, space: number = null) {
121 const list = []

Callers 1

parseFunction · 0.90

Calls 1

decodeFunction · 0.85

Tested by

no test coverage detected