underscore.deepclone

    0.1.3 • Public • Published

    underscore.deepclone Build Status

    This library is an extension for Underscore which allows cloning objects recursively until the pointer tree ends. However, if your object has circular reference it could lead into an infinite loop.

    Features

    • Deep clone nested objects.

    Dependencies

    • underscore.js (>= 1.5.0)

    Node

    var _ = require('underscore');
    _.mixin(require('underscore.deepclone'));

    Examples

    var object = {foo: {bar: 123}};
    var objectClone = _.clone(object);
    var objectDeepClone = _.deepClone(object);
     
    object.foo == objectClone.foo; // true
    object.foo == objectDeepClone.foo; // false

    License

    Copyright (c) 2013-2014 Mateus Maso. Released under an MIT license.

    Install

    npm i underscore.deepclone

    DownloadsWeekly Downloads

    665

    Version

    0.1.3

    License

    none

    Last publish

    Collaborators

    • avatar