dist/@ajsf/core/esm2015/lib/shared/validator.functions.js
/**
 * '_mergeObjects' utility function
 *
 * Recursively Merges one or more objects into a single object with combined keys.
 * Automatically detects and ignores null and undefined inputs.
 * Also detects duplicated boolean 'not' keys and XORs their values.
 *
 * //  { PlainObject[] } objects - one or more objects to merge
 * // { PlainObject } - merged object
 */
'_mergeObjects' utility function
Recursively Merges one or more objects into a single object with combined keys.
Automatically detects and ignores null and undefined inputs.
Also detects duplicated boolean 'not' keys and XORs their values.

{ PlainObject[] } objects - one or more objects to merge
{ PlainObject } - merged object
' _mergeObjects ' utility function Recursively Merges one or more objects into a single object with combined keys . Automatically detects and ignores null and undefined inputs . Also detects duplicated boolean ' not ' keys and XORs their values . { PlainObject [] } objects - one or more objects to merge { PlainObject } - merged object
function _mergeObjects(...objects) {
    const mergedObject = {};
    for (const currentObject of objects) {
        if (isObject(currentObject)) {
            for (const key of Object.keys(currentObject)) {
                const currentValue = currentObject[key];
                const mergedValue = mergedObject[key];
                mergedObject[key] = !isDefined(mergedValue) ? currentValue :
                    key === 'not' && isBoolean(mergedValue, 'strict') &&
                        isBoolean(currentValue, 'strict') ? xor(mergedValue, currentValue) :
                        getType(mergedValue) === 'object' && getType(currentValue) === 'object' ?
                            _mergeObjects(mergedValue, currentValue) :
                            currentValue;
            }
        }
    }
    return mergedObject;
}
function _mergeObjects ( ... objects ) { const mergedObject = { } ; for ( const currentObject of objects ) { if ( isObject ( currentObject ) ) { for ( const key of Object . keys ( currentObject ) ) { const currentValue = currentObject [ key ] ; const mergedValue = mergedObject [ key ] ; mergedObject [ key ] = ! isDefined ( mergedValue ) ? currentValue : key === 'not' && isBoolean ( mergedValue , 'strict' ) && isBoolean ( currentValue , 'strict' ) ? xor ( mergedValue , currentValue ) : getType ( mergedValue ) === 'object' && getType ( currentValue ) === 'object' ? _mergeObjects ( mergedValue , currentValue ) : currentValue ; } } } return mergedObject ; }
'_mergeObjects' utility function
 Recursively Merges one or more objects into a single object with combined keys.
' _mergeObjects ' utility function Recursively Merges one or more objects into a single object with combined keys .