You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`Map` values are encoded as `{"__@json.map__":[[k,v],...]}` and `Set` values as `{"__@json.set__":[...]}`.
72
74
-`RegExp` values are encoded as `{"__@json.regexp__":{"source":"...","flags":"..."}}`.
73
75
-`URL` values are encoded as `{"__@json.url__":"..."}`.
74
-
-`Function` values are encoded as `{"__@json.function__":"<source>"}` and are only revived by `parse_UNSAFE` using `new Function(...)` (only do this with trusted input).
76
+
-`Function` values are encoded as `{"__@json.function__":"<source>"}`by `stringify_UNSAFE`and are only revived by `parse_UNSAFE` using `new Function(...)` (only do this with trusted input).
75
77
-`ArrayBuffer`, Node `Buffer` JSON shapes, and typed arrays are encoded as `{"__@json.typedarray__":{"type":"<Name>","bytes":"0x..."}}` and decoded back to the original typed array (`Uint8Array`, `Uint8ClampedArray`, `Uint16Array`, `Uint32Array`, `Int8Array`, `Int16Array`, `Int32Array`, `Float32Array`, `Float64Array`, `BigInt64Array`, `BigUint64Array`).
76
78
77
79
Compared to libraries that require eval-based parsing (for example, `serialize-javascript`), this approach is generally safer and more efficient.
0 commit comments