dist/@ajsf/core/bundles/ajsf-core.umd.js
/**
     * 'forEach' function
     *
     * Iterates over all items in the first level of an object or array
     * and calls an iterator funciton on each item.
     *
     * The iterator function is called with four values:
     * 1. The current item's value
     * 2. The current item's key
     * 3. The parent object, which contains the current item
     * 4. The root object
     *
     * Setting the optional third parameter to 'top-down' or 'bottom-up' will cause
     * it to also recursively iterate over items in sub-objects or sub-arrays in the
     * specified direction.
     *
     * // {Object|Array} object - The object or array to iterate over
     * // {function} fn - the iterator funciton to call on each item
     * // {boolean = false} errors - Show errors?
     * // {void}
     */
'forEach' function
Iterates over all items in the first level of an object or array
and calls an iterator funciton on each item.

The iterator function is called with four values:
1. The current item's value
2. The current item's key
3. The parent object, which contains the current item
4. The root object

Setting the optional third parameter to 'top-down' or 'bottom-up' will cause
it to also recursively iterate over items in sub-objects or sub-arrays in the
specified direction.

{Object|Array} object - The object or array to iterate over
{function} fn - the iterator funciton to call on each item
{boolean = false} errors - Show errors.
{void}
' forEach ' function Iterates over all items in the first level of an object or array and calls an iterator funciton on each item . The iterator function is called with four values : 1 . The current item ' s value 2 . The current item ' s key 3 . The parent object which contains the current item 4 . The root object Setting the optional third parameter to ' top - down ' or ' bottom - up ' will cause it to also recursively iterate over items in sub - objects or sub - arrays in the specified direction . { Object|Array } object - The object or array to iterate over { function } fn - the iterator funciton to call on each item { boolean = false } errors - Show errors . { void }
function forEach(object, fn, recurse, rootObject, errors) {
        var e_1, _a;
        if (recurse === void 0) { recurse = false; }
        if (rootObject === void 0) { rootObject = object; }
        if (errors === void 0) { errors = false; }
        if (isEmpty(object)) {
            return;
        }
        if ((isObject(object) || isArray(object)) && typeof fn === 'function') {
            try {
                for (var _b = __values(Object.keys(object)), _c = _b.next(); !_c.done; _c = _b.next()) {
                    var key = _c.value;
                    var value = object[key];
                    if (recurse === 'bottom-up' && (isObject(value) || isArray(value))) {
                        forEach(value, fn, recurse, rootObject);
                    }
                    fn(value, key, object, rootObject);
                    if (recurse === 'top-down' && (isObject(value) || isArray(value))) {
                        forEach(value, fn, recurse, rootObject);
                    }
                }
            }
            catch (e_1_1) { e_1 = { error: e_1_1 }; }
            finally {
                try {
                    if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                }
                finally { if (e_1) throw e_1.error; }
            }
        }
        if (errors) {
            if (typeof fn !== 'function') {
                console.error('forEach error: Iterator must be a function.');
                console.error('function', fn);
            }
            if (!isObject(object) && !isArray(object)) {
                console.error('forEach error: Input object must be an object or array.');
                console.error('object', object);
            }
        }
    }
function forEach ( object , fn , recurse , rootObject , errors ) { var e_1 , _a ; if ( recurse === void 0 ) { recurse = false ; } if ( rootObject === void 0 ) { rootObject = object ; } if ( errors === void 0 ) { errors = false ; } if ( isEmpty ( object ) ) { return ; } if ( ( isObject ( object ) || isArray ( object ) ) && typeof fn === 'function' ) { try { for ( var _b = __values ( Object . keys ( object ) ) , _c = _b . next ( ) ; ! _c . done ; _c = _b . next ( ) ) { var key = _c . value ; var value = object [ key ] ; if ( recurse === 'bottom-up' && ( isObject ( value ) || isArray ( value ) ) ) { forEach ( value , fn , recurse , rootObject ) ; } fn ( value , key , object , rootObject ) ; if ( recurse === 'top-down' && ( isObject ( value ) || isArray ( value ) ) ) { forEach ( value , fn , recurse , rootObject ) ; } } } catch ( e_1_1 ) { e_1 = { error : e_1_1 } ; } finally { try { if ( _c && ! _c . done && ( _a = _b . return ) ) _a . call ( _b ) ; } finally { if ( e_1 ) throw e_1 . error ; } } } if ( errors ) { if ( typeof fn !== 'function' ) { console . error ( 'forEach error: Iterator must be a function.' ) ; console . error ( 'function' , fn ) ; } if ( ! isObject ( object ) && ! isArray ( object ) ) { console . error ( 'forEach error: Input object must be an object or array.' ) ; console . error ( 'object' , object ) ; } } }
'forEach' function
 Iterates over all items in the first level of an object or array
 and calls an iterator funciton on each item.
' forEach ' function Iterates over all items in the first level of an object or array and calls an iterator funciton on each item .