pkgconfig.js
function merge(target, source) {
    if (source === null) {
        return target
    }
    var props = Object.getOwnPropertyNames(target)
    props.forEach(function (name) {
        var s = gettype(source[name])
        if (s !== 'undefined') {
            var t = gettype(target[name])
            if (t !== s) {
                throw new Error(`Type mismatch between '${t}' and '${s}' for '${name}'`)
            }
            if (t === 'object') {
                merge(target[name], source[name])
            } else {
                target[name] = source[name]
            }
        }
    })
    return target
}
function merge(target, source) {
    if (source === null) {
        return target
    }
    var props = Object.getOwnPropertyNames(target)
    props.forEach(function (name) {
        var s = gettype(source[name])
        if (s !== 'undefined') {
            var t = gettype(target[name])
            if (t !== s) {
                throw new Error(`Type mismatch between '${t}' and '${s}' for '${name}'`)
            }
            if (t === 'object') {
                merge(target[name], source[name])
            } else {
                target[name] = source[name]
            }
        }
    })
    return target
}
function merge ( target , source ) { if ( source === null ) { return target } var props = Object . getOwnPropertyNames ( target ) props . forEach ( function ( name ) { var s = gettype ( source [ name ] ) if ( s !== 'undefined' ) { var t = gettype ( target [ name ] ) if ( t !== s ) { throw new Error ( ` ${ t } ${ s } ${ name } ` ) } if ( t === 'object' ) { merge ( target [ name ] , source [ name ] ) } else { target [ name ] = source [ name ] } } } ) return target }
Merges the source with the target. The target is modified and returned.
Merges the source with the target . The target is modified and returned .