lib/utils.js
function clone(obj) {
    if (typeof obj !== 'object') {
        return obj;
    }
    var ret;
    if (util.isArray(obj)) {
        ret = [];
        obj.forEach(function (val) {
            ret.push(clone(val));
        });
        return ret;
    }
    ret = {};
    Object.keys(obj).forEach(function (key) {
        ret[key] = clone(obj[key]);
    });
    return ret;
}
function clone(obj) {
    if (typeof obj !== 'object') {
        return obj;
    }
    var ret;
    if (util.isArray(obj)) {
        ret = [];
        obj.forEach(function (val) {
            ret.push(clone(val));
        });
        return ret;
    }
    ret = {};
    Object.keys(obj).forEach(function (key) {
        ret[key] = clone(obj[key]);
    });
    return ret;
}
function clone ( obj ) { if ( typeof obj !== 'object' ) { return obj ; } var ret ; if ( util . isArray ( obj ) ) { ret = [ ] ; obj . forEach ( function ( val ) { ret . push ( clone ( val ) ) ; } ) ; return ret ; } ret = { } ; Object . keys ( obj ) . forEach ( function ( key ) { ret [ key ] = clone ( obj [ key ] ) ; } ) ; return ret ; }
Function for creating a clone of an object

@param o {Object}  object to clone
@return {Object}
Function for creating a clone of an object