dist/@ajsf/core/esm2015/lib/shared/utility.functions.js
/**
 * 'mergeFilteredObject' utility function
 *
 * Shallowly merges two objects, setting key and values from source object
 * in target object, excluding specified keys.
 *
 * Optionally, it can also use functions to transform the key names and/or
 * the values of the merging object.
 *
 * // {PlainObject} targetObject - Target object to add keys and values to
 * // {PlainObject} sourceObject - Source object to copy keys and values from
 * // {string[]} excludeKeys - Array of keys to exclude
 * // {(string: string) => string = (k) => k} keyFn - Function to apply to keys
 * // {(any: any) => any = (v) => v} valueFn - Function to apply to values
 * // {PlainObject} - Returns targetObject
 */
'mergeFilteredObject' utility function
Shallowly merges two objects, setting key and values from source object
in target object, excluding specified keys.

Optionally, it can also use functions to transform the key names and/or
the values of the merging object.


' mergeFilteredObject ' utility function Shallowly merges two objects setting key and values from source object in target object excluding specified keys . Optionally it can also use functions to transform the key names and / or the values of the merging object .
function mergeFilteredObject(targetObject, sourceObject, excludeKeys = [], keyFn = (key) => key, valFn = (val) => val) {
    if (!isObject(sourceObject)) {
        return targetObject;
    }
    if (!isObject(targetObject)) {
        targetObject = {};
    }
    for (const key of Object.keys(sourceObject)) {
        if (!inArray(key, excludeKeys) && isDefined(sourceObject[key])) {
            targetObject[keyFn(key)] = valFn(sourceObject[key]);
        }
    }
    return targetObject;
}
function mergeFilteredObject ( targetObject , sourceObject , excludeKeys = [ ] , keyFn = ( key ) => key , valFn = ( val ) => val ) { if ( ! isObject ( sourceObject ) ) { return targetObject ; } if ( ! isObject ( targetObject ) ) { targetObject = { } ; } for ( const key of Object . keys ( sourceObject ) ) { if ( ! inArray ( key , excludeKeys ) && isDefined ( sourceObject [ key ] ) ) { targetObject [ keyFn ( key ) ] = valFn ( sourceObject [ key ] ) ; } } return targetObject ; }
'mergeFilteredObject' utility function
 Shallowly merges two objects, setting key and values from source object
 in target object, excluding specified keys.
' mergeFilteredObject ' utility function Shallowly merges two objects setting key and values from source object in target object excluding specified keys .