Sha256: 2209e6f755d7e18d2be281e39fa787cbd324bed3eb5ac4306bf4f2215997ea57

Contents?: true

Size: 976 Bytes

Versions: 23

Compression:

Stored size: 976 Bytes

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = _default;
function deepClone(value, cache) {
  if (value !== null) {
    if (cache.has(value)) return cache.get(value);
    let cloned;
    if (Array.isArray(value)) {
      cloned = new Array(value.length);
      cache.set(value, cloned);
      for (let i = 0; i < value.length; i++) {
        cloned[i] = typeof value[i] !== "object" ? value[i] : deepClone(value[i], cache);
      }
    } else {
      cloned = {};
      cache.set(value, cloned);
      const keys = Object.keys(value);
      for (let i = 0; i < keys.length; i++) {
        const key = keys[i];
        cloned[key] = typeof value[key] !== "object" ? value[key] : deepClone(value[key], cache);
      }
    }
    return cloned;
  }
  return value;
}
function _default(value) {
  if (typeof value !== "object") return value;
  return deepClone(value, new Map());
}
0 && 0;

//# sourceMappingURL=clone-deep.js.map

Version data entries

23 entries across 16 versions & 3 rubygems

Version Path
trusty-cms-6.3.1 node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.51 node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.51 node_modules/jscodeshift/node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.50 node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.50 node_modules/jscodeshift/node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.49 node_modules/jscodeshift/node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.49 node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.48 node_modules/jscodeshift/node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.48 node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.47 node_modules/jscodeshift/node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.47 node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.46 node_modules/jscodeshift/node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.46 node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.45 node_modules/jscodeshift/node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.45 node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.44 node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.43 node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.42 node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.41 node_modules/@babel/core/lib/transformation/util/clone-deep.js
immosquare-cleaner-0.1.40 node_modules/@babel/core/lib/transformation/util/clone-deep.js