wizer 10.0.0

The WebAssembly Pre-Initializer
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { isPlainObject } from "is-plain-object";
export function mergeDeep(defaults, options) {
    const result = Object.assign({}, defaults);
    Object.keys(options).forEach((key) => {
        if (isPlainObject(options[key])) {
            if (!(key in defaults))
                Object.assign(result, { [key]: options[key] });
            else
                result[key] = mergeDeep(defaults[key], options[key]);
        }
        else {
            Object.assign(result, { [key]: options[key] });
        }
    });
    return result;
}