dist/@ajsf/core/esm2015/lib/shared/jsonpointer.functions.js
/**
     * 'forEachDeepCopy' function
     *
     * Similar to forEachDeep, but returns a copy of the original object, with
     * the same keys and indexes, but with values replaced with the result of
     * the iteratee function.
     *
     * //  { object } object - the initial object or array
     * //  { (v: any, k?: string, o?: any, p?: any) => any } function - iteratee function
     * //  { boolean = false } bottomUp - optional, set to TRUE to reverse direction
     * //  { object = object } rootObject - optional, root object or array
     * //  { string = '' } pointer - optional, JSON Pointer to object within rootObject
     * // { object } - The copied object
     */
'forEachDeepCopy' function
Similar to forEachDeep, but returns a copy of the original object, with
the same keys and indexes, but with values replaced with the result of
the iteratee function.


' forEachDeepCopy ' function Similar to forEachDeep but returns a copy of the original object with the same keys and indexes but with values replaced with the result of the iteratee function .
static forEachDeepCopy(object, fn = (v) => v, bottomUp = false, pointer = '', rootObject = object) {
        if (typeof fn !== 'function') {
            console.error(`forEachDeepCopy error: Iterator is not a function:`, fn);
            return null;
        }
        if (isObject(object) || isArray(object)) {
            let newObject = isArray(object) ? [...object] : Object.assign({}, object);
            if (!bottomUp) {
                newObject = fn(newObject, pointer, rootObject);
            }
            for (const key of Object.keys(newObject)) {
                const newPointer = pointer + '/' + this.escape(key);
                newObject[key] = this.forEachDeepCopy(newObject[key], fn, bottomUp, newPointer, rootObject);
            }
            if (bottomUp) {
                newObject = fn(newObject, pointer, rootObject);
            }
            return newObject;
        }
        else {
            return fn(object, pointer, rootObject);
        }
    }
static forEachDeepCopy ( object , fn = ( v ) => v , bottomUp = false , pointer = '' , rootObject = object ) { if ( typeof fn !== 'function' ) { console . error ( ` ` , fn ) ; return null ; } if ( isObject ( object ) || isArray ( object ) ) { let newObject = isArray ( object ) ? [ ... object ] : Object . assign ( { } , object ) ; if ( ! bottomUp ) { newObject = fn ( newObject , pointer , rootObject ) ; } for ( const key of Object . keys ( newObject ) ) { const newPointer = pointer + '/' + this . escape ( key ) ; newObject [ key ] = this . forEachDeepCopy ( newObject [ key ] , fn , bottomUp , newPointer , rootObject ) ; } if ( bottomUp ) { newObject = fn ( newObject , pointer , rootObject ) ; } return newObject ; } else { return fn ( object , pointer , rootObject ) ; } }
'forEachDeepCopy' function
 Similar to forEachDeep, but returns a copy of the original object, with
 the same keys and indexes, but with values replaced with the result of
 the iteratee function.
' forEachDeepCopy ' function Similar to forEachDeep but returns a copy of the original object with the same keys and indexes but with values replaced with the result of the iteratee function .