src/utils.js
function deepClone(o, _clone = {}, _depth = 0) {
    // TODO: Handle invalid input o is null, undefined, empty object
    const oKeys = Object.keys(o);

    // TODO: handle arrays
    for (let k of oKeys) {
        const nested = _isPropertyNestedObject(o, k);

        _clone[k] = nested && _depth < MAX_DEPTH ? deepClone(o[k], {}, _depth + 1) : o[k];
    }

    return _clone;
}
function deepClone(o, _clone = {}, _depth = 0) {
    // TODO: Handle invalid input o is null, undefined, empty object
    const oKeys = Object.keys(o);

    // TODO: handle arrays
    for (let k of oKeys) {
        const nested = _isPropertyNestedObject(o, k);

        _clone[k] = nested && _depth < MAX_DEPTH ? deepClone(o[k], {}, _depth + 1) : o[k];
    }

    return _clone;
}
function deepClone ( o , _clone = { } , _depth = 0 ) { // TODO: Handle invalid input o is null, undefined, empty object const oKeys = Object . keys ( o ) ; // TODO: handle arrays for ( let k of oKeys ) { const nested = _isPropertyNestedObject ( o , k ) ; _clone [ k ] = nested && _depth < MAX_DEPTH ? deepClone ( o [ k ] , { } , _depth + 1 ) : o [ k ] ; } return _clone ; }
Function to deep clone plain javascript objects.
@param {Object} o - the object to clone.
@param {Object} _clone - carries the cloned output throughout the
recursive calls. Parameter serves only for internal usage.
@param {number} _depth - this parameter serves only for internal usage.
@returns {Object} - the cloned object.
@memberof utils
Function to deep clone plain javascript objects .