@dhmk/utils
Advanced tools
Comparing version 4.3.0 to 4.3.1
@@ -22,9 +22,9 @@ import { StrKeyOf, DeepReadonly, DeepPartial } from "./types"; | ||
declare type Merge = { | ||
<T>(a: T, b: Partial<T>): T; | ||
<T, P = Partial<T>>(b: P): (a: T) => T; | ||
<T>(a: T, b: Partial<T> | ((a: T) => Partial<T>)): T; | ||
<T, P extends T = T>(b: Partial<P> | ((a: T) => Partial<P>)): (a: T) => T; | ||
}; | ||
export declare const merge: Merge; | ||
declare type MergeDeep = { | ||
<T>(a: T, b: DeepPartial<T>): T; | ||
<T, P = DeepPartial<T>>(b: P): (a: T) => T; | ||
<T>(a: T, b: DeepPartial<T> | ((a: T) => DeepPartial<T>)): T; | ||
<T, P extends T = T>(b: DeepPartial<P> | ((a: T) => DeepPartial<P>)): (a: T) => T; | ||
}; | ||
@@ -31,0 +31,0 @@ export declare const mergeDeep: MergeDeep; |
@@ -87,4 +87,5 @@ var __assign = (this && this.__assign) || function () { | ||
export var deepReadonly = function (x) { return x; }; | ||
var merge2 = function (a, b) { return (__assign(__assign({}, a), (typeof b === "function" ? b(a) : b))); }; | ||
export var merge = function (a, b) { | ||
return b ? __assign(__assign({}, a), b) : function (b) { return (__assign(__assign({}, b), a)); }; | ||
return b ? merge2(a, b) : function (b) { return merge2(b, a); }; | ||
}; | ||
@@ -100,4 +101,7 @@ var mergeDeepRec = function (a, b) { | ||
}; | ||
var mergeDeep2 = function (a, b) { | ||
return mergeDeepRec(a, typeof b === "function" ? b(a) : b); | ||
}; | ||
export var mergeDeep = function (a, b) { | ||
return b ? mergeDeepRec(a, b) : function (b) { return mergeDeepRec(b, a); }; | ||
return b ? mergeDeep2(a, b) : function (b) { return mergeDeep2(b, a); }; | ||
}; | ||
@@ -104,0 +108,0 @@ export var join = function (a, sep, b) { return (a + sep + b); }; |
@@ -22,9 +22,9 @@ import { StrKeyOf, DeepReadonly, DeepPartial } from "./types"; | ||
declare type Merge = { | ||
<T>(a: T, b: Partial<T>): T; | ||
<T, P = Partial<T>>(b: P): (a: T) => T; | ||
<T>(a: T, b: Partial<T> | ((a: T) => Partial<T>)): T; | ||
<T, P extends T = T>(b: Partial<P> | ((a: T) => Partial<P>)): (a: T) => T; | ||
}; | ||
export declare const merge: Merge; | ||
declare type MergeDeep = { | ||
<T>(a: T, b: DeepPartial<T>): T; | ||
<T, P = DeepPartial<T>>(b: P): (a: T) => T; | ||
<T>(a: T, b: DeepPartial<T> | ((a: T) => DeepPartial<T>)): T; | ||
<T, P extends T = T>(b: DeepPartial<P> | ((a: T) => DeepPartial<P>)): (a: T) => T; | ||
}; | ||
@@ -31,0 +31,0 @@ export declare const mergeDeep: MergeDeep; |
@@ -103,4 +103,5 @@ "use strict"; | ||
exports.deepReadonly = deepReadonly; | ||
var merge2 = function (a, b) { return (__assign(__assign({}, a), (typeof b === "function" ? b(a) : b))); }; | ||
var merge = function (a, b) { | ||
return b ? __assign(__assign({}, a), b) : function (b) { return (__assign(__assign({}, b), a)); }; | ||
return b ? merge2(a, b) : function (b) { return merge2(b, a); }; | ||
}; | ||
@@ -117,4 +118,7 @@ exports.merge = merge; | ||
}; | ||
var mergeDeep2 = function (a, b) { | ||
return mergeDeepRec(a, typeof b === "function" ? b(a) : b); | ||
}; | ||
var mergeDeep = function (a, b) { | ||
return b ? mergeDeepRec(a, b) : function (b) { return mergeDeepRec(b, a); }; | ||
return b ? mergeDeep2(a, b) : function (b) { return mergeDeep2(b, a); }; | ||
}; | ||
@@ -121,0 +125,0 @@ exports.mergeDeep = mergeDeep; |
{ | ||
"name": "@dhmk/utils", | ||
"version": "4.3.0", | ||
"version": "4.3.1", | ||
"description": "A collection of frequently used functions and primitives", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
125717
2898