Sha256: 6db21cb9bce8883e7e04618fd3db1d253488e1dc20a656cdb28948ab086b976a

Contents?: true

Size: 500 Bytes

Versions: 7

Compression:

Stored size: 500 Bytes

Contents

const serialized = "$$ babel internal serialized type" + Math.random();

function serialize(key, value) {
  if (typeof value !== "bigint") return value;
  return {
    [serialized]: "BigInt",
    value: value.toString(),
  };
}

function revive(key, value) {
  if (!value || typeof value !== "object") return value;
  if (value[serialized] !== "BigInt") return value;
  return BigInt(value.value);
}

export default function (value) {
  return JSON.parse(JSON.stringify(value, serialize), revive);
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
disco_app-0.16.1 test/dummy/node_modules/@babel/core/src/transformation/util/clone-deep-browser.ts
disco_app-0.15.2 test/dummy/node_modules/@babel/core/src/transformation/util/clone-deep-browser.ts
disco_app-0.18.4 test/dummy/node_modules/@babel/core/src/transformation/util/clone-deep-browser.ts
disco_app-0.18.1 test/dummy/node_modules/@babel/core/src/transformation/util/clone-deep-browser.ts
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/@babel/core/src/transformation/util/clone-deep-browser.ts
disco_app-0.14.0 test/dummy/node_modules/@babel/core/src/transformation/util/clone-deep-browser.ts
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/@babel/core/src/transformation/util/clone-deep-browser.ts