Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@webundsoehne/deep-merge

Package Overview
Dependencies
Maintainers
2
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@webundsoehne/deep-merge - npm Package Compare versions

Comparing version 2.2.6 to 3.0.0

1

dist/index.d.ts
export { deepMerge, deepMergeWithArrayOverwrite, deepMergeWithUniqueMergeArray, uniqueArrayFilter } from './merge.js';
import '@webundsoehne/ts-utility-types';

14

dist/merge.d.ts

@@ -0,1 +1,3 @@

import { DeepPartial } from '@webundsoehne/ts-utility-types';
/**

@@ -5,6 +7,4 @@ * Merge objects with defaults.

* Mutates the object.
* @param t
* @param s
*/
declare function deepMerge<T extends Record<string, any>>(t: T, ...s: Partial<T>[]): T;
declare function deepMerge<T extends Record<PropertyKey, any>>(t: T, ...s: DeepPartial<T>[]): T;
/**

@@ -14,6 +14,4 @@ * Merge objects with array merge and filtering them uniquely.

* Mutates the object.
* @param t
* @param s
*/
declare function deepMergeWithUniqueMergeArray<T extends Record<string, any>>(t: T, ...s: Partial<T>[]): T;
declare function deepMergeWithUniqueMergeArray<T extends Record<PropertyKey, any>>(t: T, ...s: DeepPartial<T>[]): T;
/**

@@ -23,6 +21,4 @@ * Merge objects with overwriting the target array with source array.

* Mutates the object.
* @param t
* @param s
*/
declare function deepMergeWithArrayOverwrite<T extends Record<string, any>>(t: T, ...s: Partial<T>[]): T;
declare function deepMergeWithArrayOverwrite<T extends Record<PropertyKey, any>>(t: T, ...s: DeepPartial<T>[]): T;
/**

@@ -29,0 +25,0 @@ * A standard array filter for filtering it to unique items.

@@ -35,10 +35,10 @@ var __create = Object.create;

function deepMerge(t, ...s) {
return s.reduce((o, val) => {
return (0, import_deepmerge.default)(o, val ?? {});
}, t);
return deepMergeWithUniqueMergeArray(t, ...s);
}
__name(deepMerge, "deepMerge");
function deepMergeWithUniqueMergeArray(t, ...s) {
return s.reduce((o, val) => {
return (0, import_deepmerge.default)(o, val ?? {}, {
return import_deepmerge.default.all([
t,
...s ?? [],
{
arrayMerge: (target, source) => [

@@ -48,12 +48,14 @@ ...target,

].filter(uniqueArrayFilter)
});
}, t);
}
]);
}
__name(deepMergeWithUniqueMergeArray, "deepMergeWithUniqueMergeArray");
function deepMergeWithArrayOverwrite(t, ...s) {
return s.reduce((o, val) => {
return (0, import_deepmerge.default)(o, val ?? {}, {
return import_deepmerge.default.all([
t,
...s ?? [],
{
arrayMerge: (_, source) => source
});
}, t);
}
]);
}

@@ -60,0 +62,0 @@ __name(deepMergeWithArrayOverwrite, "deepMergeWithArrayOverwrite");

{
"name": "@webundsoehne/deep-merge",
"description": "Generic object deepmerge.",
"version": "2.2.6",
"version": "3.0.0",
"author": "Backend <backend@webundsoehne.com>",

@@ -6,0 +6,0 @@ "repository": "https://github.com/tailoredmedia/backend-nx-skeleton",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc