apphouse
Version:
Component library for React that uses observable state management and theme-able components.
15 lines (13 loc) • 348 B
text/typescript
import { isObject } from './isObject';
export function merge(target: any, ...sources: any) {
for (const source of sources) {
for (const key in source) {
if (isObject(target[key]) && isObject(source[key])) {
merge(target[key], source[key]);
} else {
target[key] = source[key];
}
}
}
return target;
}