@punks/backend-core 0.0.35 → 0.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -281,6 +281,21 @@ const buildObject = (...props) => {
281
281
  }
282
282
  return out;
283
283
  };
284
+ const mergeDeep = (a, b) => {
285
+ const c = { ...(a ?? {}) };
286
+ for (const key in b ?? {}) {
287
+ if (b.hasOwnProperty(key)) {
288
+ const value = b[key];
289
+ if (typeof value === "object" && !Array.isArray(value)) {
290
+ c[key] = mergeDeep(c[key] ?? {}, value);
291
+ }
292
+ else {
293
+ c[key] = value;
294
+ }
295
+ }
296
+ }
297
+ return c;
298
+ };
284
299
 
285
300
  const pluralize = (word) => {
286
301
  return word.endsWith("s") ? `${word}es` : `${word}s`;
@@ -28528,6 +28543,7 @@ exports.joinPath = joinPath;
28528
28543
  exports.jsonDistinct = jsonDistinct;
28529
28544
  exports.last = last;
28530
28545
  exports.mapOrThrow = mapOrThrow;
28546
+ exports.mergeDeep = mergeDeep;
28531
28547
  exports.newUuid = newUuid;
28532
28548
  exports.notNull = notNull;
28533
28549
  exports.notUndefined = notUndefined;