Testing actions

This commit is contained in:
Janos 2021-07-28 08:24:31 +02:00
commit 8a260b16ec
No known key found for this signature in database
GPG key ID: 465EF45E51CBA2BA
340 changed files with 72676 additions and 0 deletions

View file

@ -0,0 +1,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;
}