(result: unknown)
| 125 | } |
| 126 | |
| 127 | export 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 | |
| 152 | function deserializeTaggedValue({ $type, value }: JsonInputTaggedValue | JsonOutputTaggedValue): JsOutputValue { |
| 153 | switch ($type) { |
no test coverage detected