1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = _default;
|
7 | const serialized = "$$ babel internal serialized type" + Math.random();
|
8 |
|
9 | function serialize(key, value) {
|
10 | if (typeof value !== "bigint") return value;
|
11 | return {
|
12 | [serialized]: "BigInt",
|
13 | value: value.toString()
|
14 | };
|
15 | }
|
16 |
|
17 | function revive(key, value) {
|
18 | if (!value || typeof value !== "object") return value;
|
19 | if (value[serialized] !== "BigInt") return value;
|
20 | return BigInt(value.value);
|
21 | }
|
22 |
|
23 | function _default(value) {
|
24 | return JSON.parse(JSON.stringify(value, serialize), revive);
|
25 | } |
\ | No newline at end of file |