merge-anything 5.0.2 → 5.0.3
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/README.md +1 -1
- package/dist/types/merge.d.ts +7 -3
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -167,7 +167,7 @@ However, **there is a really easy solution**. We can just copy the merge result
|
|
|
167
167
|
See below how we integrate 'copy-anything':
|
|
168
168
|
|
|
169
169
|
```js
|
|
170
|
-
import copy from 'copy-anything'
|
|
170
|
+
import { copy } from 'copy-anything'
|
|
171
171
|
|
|
172
172
|
const original = { airport: { status: 'dep. 🛫' } }
|
|
173
173
|
const extraInfo = { airport: { location: 'Brussels' } }
|
package/dist/types/merge.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { O } from 'ts-toolbelt';
|
|
2
|
+
declare type ExpandDeep<T> = T extends Record<string | number | symbol, unknown> ? {
|
|
3
|
+
[K in keyof T]: ExpandDeep<T[K]>;
|
|
4
|
+
} : T extends Array<infer E> ? Array<ExpandDeep<E>> : T;
|
|
2
5
|
/**
|
|
3
6
|
* Merge anything recursively.
|
|
4
7
|
* Objects get merged, special objects (classes etc.) are re-assigned "as is".
|
|
@@ -6,6 +9,7 @@ import { O } from 'ts-toolbelt';
|
|
|
6
9
|
* @param object
|
|
7
10
|
* @param otherObjects
|
|
8
11
|
*/
|
|
9
|
-
export declare function merge<T extends Record<string, any>, Tn extends Record<string, any>[]>(object: T, ...otherObjects: Tn): O.Assign<T, Tn, 'deep'
|
|
10
|
-
export declare function mergeAndCompare<T extends Record<string, any>, Tn extends Record<string, any>[]>(compareFn: (prop1: any, prop2: any, propName: string | symbol) => any, object: T, ...otherObjects: Tn): O.Assign<T, Tn, 'deep'
|
|
11
|
-
export declare function mergeAndConcat<T extends Record<string, any>, Tn extends Record<string, any>[]>(object: T, ...otherObjects: Tn): O.Assign<T, Tn, 'deep'
|
|
12
|
+
export declare function merge<T extends Record<string, any>, Tn extends Record<string, any>[]>(object: T, ...otherObjects: Tn): ExpandDeep<O.Assign<T, Tn, 'deep'>>;
|
|
13
|
+
export declare function mergeAndCompare<T extends Record<string, any>, Tn extends Record<string, any>[]>(compareFn: (prop1: any, prop2: any, propName: string | symbol) => any, object: T, ...otherObjects: Tn): ExpandDeep<O.Assign<T, Tn, 'deep'>>;
|
|
14
|
+
export declare function mergeAndConcat<T extends Record<string, any>, Tn extends Record<string, any>[]>(object: T, ...otherObjects: Tn): ExpandDeep<O.Assign<T, Tn, 'deep'>>;
|
|
15
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "merge-anything",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Merge objects & other types recursively. A simple & small integration.",
|
|
@@ -60,22 +60,22 @@
|
|
|
60
60
|
},
|
|
61
61
|
"homepage": "https://github.com/mesqueeb/merge-anything#readme",
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"is-what": "^4.1.
|
|
63
|
+
"is-what": "^4.1.7",
|
|
64
64
|
"ts-toolbelt": "^9.6.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
68
|
-
"@typescript-eslint/parser": "^5.
|
|
69
|
-
"del-cli": "^
|
|
70
|
-
"eslint": "^8.
|
|
71
|
-
"eslint-config-prettier": "^8.
|
|
67
|
+
"@typescript-eslint/eslint-plugin": "^5.34.0",
|
|
68
|
+
"@typescript-eslint/parser": "^5.34.0",
|
|
69
|
+
"del-cli": "^5.0.0",
|
|
70
|
+
"eslint": "^8.22.0",
|
|
71
|
+
"eslint-config-prettier": "^8.5.0",
|
|
72
72
|
"eslint-plugin-tree-shaking": "^1.10.0",
|
|
73
|
-
"np": "^7.6.
|
|
74
|
-
"prettier": "^2.
|
|
75
|
-
"rollup": "^2.
|
|
76
|
-
"rollup-plugin-typescript2": "^0.
|
|
77
|
-
"typescript": "^4.
|
|
78
|
-
"vitest": "^0.
|
|
73
|
+
"np": "^7.6.2",
|
|
74
|
+
"prettier": "^2.7.1",
|
|
75
|
+
"rollup": "^2.78.1",
|
|
76
|
+
"rollup-plugin-typescript2": "^0.33.0",
|
|
77
|
+
"typescript": "^4.7.4",
|
|
78
|
+
"vitest": "^0.22.1"
|
|
79
79
|
},
|
|
80
80
|
"np": {
|
|
81
81
|
"yarn": false,
|