MCPcopy
hub / github.com/styletron/styletron / deepMerge

Function deepMerge

packages/styletron-react/src/index.tsx:582–596  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

580}
581
582function deepMerge(a, b) {
583 const result = assign({}, a);
584
585 for (const key in b) {
586 const val = b[key];
587
588 if (isObject(val) && isObject(a[key])) {
589 result[key] = deepMerge(a[key], val);
590 } else {
591 result[key] = val;
592 }
593 }
594
595 return result;
596}
597
598function shallowMerge(a, b) {
599 return assign(assign({}, a), b);

Callers 3

dynamicComposeDeepFunction · 0.85
createDeepMergeReducerFunction · 0.85

Calls 2

assignFunction · 0.85
isObjectFunction · 0.85

Tested by

no test coverage detected