(payload: SuperJSONResult, options?: { inPlace?: boolean })
| 61 | } |
| 62 | |
| 63 | deserialize<T = unknown>(payload: SuperJSONResult, options?: { inPlace?: boolean }): T { |
| 64 | const { json, meta } = payload; |
| 65 | |
| 66 | let result: T = options?.inPlace ? json : copy(json) as any; |
| 67 | |
| 68 | if (meta?.values) { |
| 69 | result = applyValueAnnotations(result, meta.values, meta.v ?? 0, this); |
| 70 | } |
| 71 | |
| 72 | if (meta?.referentialEqualities) { |
| 73 | result = applyReferentialEqualityAnnotations( |
| 74 | result, |
| 75 | meta.referentialEqualities, |
| 76 | meta.v ?? 0 |
| 77 | ); |
| 78 | } |
| 79 | |
| 80 | return result; |
| 81 | } |
| 82 | |
| 83 | stringify(object: SuperJSONValue): string { |
| 84 | return JSON.stringify(this.serialize(object)); |
no test coverage detected