packages/reftools/lib/clone.js
function deepClone(obj) {
    let result = Array.isArray(obj) ? [] : {};
    for (let p in obj) {
        if (obj.hasOwnProperty(p) || Array.isArray(obj)) {
            result[p] = (typeof obj[p] === 'object') ? deepClone(obj[p]) : obj[p];
        }
    }
    return result;
}
function deepClone(obj) {
    let result = Array.isArray(obj) ? [] : {};
    for (let p in obj) {
        if (obj.hasOwnProperty(p) || Array.isArray(obj)) {
            result[p] = (typeof obj[p] === 'object') ? deepClone(obj[p]) : obj[p];
        }
    }
    return result;
}
function deepClone ( obj ) { let result = Array . isArray ( obj ) ? [ ] : { } ; for ( let p in obj ) { if ( obj . hasOwnProperty ( p ) || Array . isArray ( obj ) ) { result [ p ] = ( typeof obj [ p ] === 'object' ) ? deepClone ( obj [ p ] ) : obj [ p ] ; } } return result ; }
clones the given object's properties deeply, ignores properties from prototype
@param obj the object to clone
@return the cloned object
clones the given object s properties deeply ignores properties from prototype