How to use nanoclone - 10 common examples

To help you get started, we’ve selected a few nanoclone examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mesqueeb / vuex-easy-firestore / dist / index.umd.js View on Github external
function merger(a, b) {
      if (b === void 0) {
        return nanoclone(a);
      }

      var type = determineType(a, b);

      if (!type) {
        return nanoclone(b);
      }

      var strategy = config.strategy[type.name] || type.default;

      return type.merge[strategy](merger, a, b);
    }
github mesqueeb / vuex-easy-firestore / dist / index.umd.js View on Github external
function merger(a, b) {
      if (b === void 0) {
        return nanoclone(a);
      }

      var type = determineType(a, b);

      if (!type) {
        return nanoclone(b);
      }

      var strategy = config.strategy[type.name] || type.default;

      return type.merge[strategy](merger, a, b);
    }
github mesqueeb / vuex-easy-firestore / dist / index.iife.js View on Github external
function merger(a, b) {
      if (b === void 0) {
        return nanoclone(a);
      }

      var type = determineType(a, b);

      if (!type) {
        return nanoclone(b);
      }

      var strategy = config.strategy[type.name] || type.default;

      return type.merge[strategy](merger, a, b);
    }
github mesqueeb / vuex-easy-firestore / dist / index.iife.js View on Github external
replace: function replace(merger, a, b) {
        return nanoclone(b);
      },
github mesqueeb / vuex-easy-firestore / dist / index.iife.js View on Github external
function merger(a, b) {
      if (b === void 0) {
        return nanoclone(a);
      }

      var type = determineType(a, b);

      if (!type) {
        return nanoclone(b);
      }

      var strategy = config.strategy[type.name] || type.default;

      return type.merge[strategy](merger, a, b);
    }
github mesqueeb / vuex-easy-firestore / dist / index.umd.js View on Github external
replace: function replace(merger, a, b) {
        return nanoclone(b);
      },
github nikolay-govorov / nanomerge / src / types.js View on Github external
function set(force, elements) {
  return force ? nanoclone(elements) : elements;
}
github nikolay-govorov / nanomerge / src / merge.js View on Github external
step(a, b) {
    if (b === undefined) {
      return this.config.force ? nanoclone(a) : a;
    }

    const type = this.determineType(a, b);

    if (!type) {
      return this.config.force ? nanoclone(b) : b;
    }

    const strategy = this.config.strategy[type.name] || type.default;
    const merge = this.step.bind(this);
    const config = { force: this.config.force };

    return type.merge[strategy](merge, config, a, b);
  }
github apicase / core / lib / utils.js View on Github external
export function defaults(def, obj) {
  return Object.keys(obj).reduce(function(res, key) {
    res[key] = obj[key] || res[key]
    return res
  }, clone(def))
}
github nikolay-govorov / nanomerge / src / merge.js View on Github external
step(a, b) {
    if (b === undefined) {
      return this.config.force ? nanoclone(a) : a;
    }

    const type = this.determineType(a, b);

    if (!type) {
      return this.config.force ? nanoclone(b) : b;
    }

    const strategy = this.config.strategy[type.name] || type.default;
    const merge = this.step.bind(this);
    const config = { force: this.config.force };

    return type.merge[strategy](merge, config, a, b);
  }

nanoclone

300B to deep clone JavaScript objects

MIT
Latest version published 11 months ago

Package Health Score

71 / 100
Full package analysis

Popular nanoclone functions