MCPcopy
hub / github.com/mailvelope/mailvelope / deepMerge

Function deepMerge

test/integration/setup/test-harness.js:109–118  ·  view source on GitHub ↗
(target, source)

Source from the content-addressed store, hash-verified

107 try {
108 // Deep merge preferences
109 const deepMerge = (target, source) => {
110 Object.keys(source).forEach(key => {
111 if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {
112 target[key] = target[key] || {};
113 deepMerge(target[key], source[key]);
114 } else {
115 target[key] = source[key];
116 }
117 });
118 };
119 deepMerge(prefs, prefUpdates);
120 } catch (error) {
121 console.error('testHarness.setPrefs: Failed to set preferences:', error);

Callers 1

test-harness.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected