MCPcopy
hub / github.com/prisma/prisma / deserializeJsonObject

Function deserializeJsonObject

packages/client-engine-runtime/src/json-protocol.ts:127–150  ·  view source on GitHub ↗
(result: unknown)

Source from the content-addressed store, hash-verified

125}
126
127export function deserializeJsonObject(result: unknown): unknown {
128 if (result === null) {
129 return result
130 }
131
132 if (Array.isArray(result)) {
133 return result.map(deserializeJsonObject)
134 }
135
136 if (typeof result === 'object') {
137 if (isTaggedValue(result)) {
138 return deserializeTaggedValue(result)
139 }
140
141 // avoid mapping class instances
142 if (result.constructor !== null && result.constructor.name !== 'Object') {
143 return result
144 }
145
146 return mapObjectValues(result, deserializeJsonObject)
147 }
148
149 return result
150}
151
152function deserializeTaggedValue({ $type, value }: JsonInputTaggedValue | JsonOutputTaggedValue): JsOutputValue {
153 switch ($type) {

Callers 5

unpackMethod · 0.90
convertCompactedRowsFunction · 0.90
#handleArrayMethod · 0.90
#handleObjectMethod · 0.90

Calls 3

deserializeTaggedValueFunction · 0.85
isTaggedValueFunction · 0.70
mapObjectValuesFunction · 0.70

Tested by

no test coverage detected