@faasjs/deep_merge 1.4.1 → 1.5.0
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 +4 -35
- package/dist/index.d.mts +13 -0
- package/dist/index.d.ts +13 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,47 +1,16 @@
|
|
|
1
1
|
# @faasjs/deep_merge
|
|
2
2
|
|
|
3
|
-
[](https://github.com/faasjs/faasjs/blob/main/packages/faasjs/deep_merge/LICENSE)
|
|
4
|
-
[](https://www.npmjs.com/package/@faasjs/deep_merge)
|
|
5
|
-
[](https://www.npmjs.com/package/@faasjs/deep_merge)
|
|
6
|
-
|
|
7
3
|
A helper function to deep merge objects and array.
|
|
8
4
|
|
|
5
|
+
[](https://github.com/faasjs/faasjs/blob/main/packages/faasjs/deep_merge/LICENSE)
|
|
6
|
+
[](https://www.npmjs.com/package/@faasjs/deep_merge)
|
|
7
|
+
|
|
9
8
|
## Install
|
|
10
9
|
|
|
11
10
|
```sh
|
|
12
11
|
npm install @faasjs/deep_merge
|
|
13
12
|
```
|
|
14
13
|
|
|
15
|
-
## Modules
|
|
16
|
-
|
|
17
|
-
### Functions
|
|
18
|
-
|
|
19
|
-
- [deepMerge](#deepmerge)
|
|
20
|
-
|
|
21
14
|
## Functions
|
|
22
15
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
▸ **deepMerge**(`...sources`): `any`
|
|
26
|
-
|
|
27
|
-
Deep merge two objects or arrays.
|
|
28
|
-
|
|
29
|
-
Features:
|
|
30
|
-
* All objects will be cloned before merging.
|
|
31
|
-
* Merging order is from right to left.
|
|
32
|
-
* If an array include same objects, it will be unique to one.
|
|
33
|
-
|
|
34
|
-
```ts
|
|
35
|
-
deepMerge({ a: 1 }, { a: 2 }) // { a: 2 }
|
|
36
|
-
deepMerge([1, 2], [2, 3]) // [1, 2, 3]
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
#### Parameters
|
|
40
|
-
|
|
41
|
-
| Name | Type |
|
|
42
|
-
| :------ | :------ |
|
|
43
|
-
| `...sources` | `any`[] |
|
|
44
|
-
|
|
45
|
-
#### Returns
|
|
46
|
-
|
|
47
|
-
`any`
|
|
16
|
+
- [deepMerge](functions/deepMerge.md)
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A helper function to deep merge objects and array.
|
|
3
|
+
*
|
|
4
|
+
* [](https://github.com/faasjs/faasjs/blob/main/packages/faasjs/deep_merge/LICENSE)
|
|
5
|
+
* [](https://www.npmjs.com/package/@faasjs/deep_merge)
|
|
6
|
+
*
|
|
7
|
+
* ## Install
|
|
8
|
+
*
|
|
9
|
+
* ```sh
|
|
10
|
+
* npm install @faasjs/deep_merge
|
|
11
|
+
* ```
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
1
14
|
/**
|
|
2
15
|
* Deep merge two objects or arrays.
|
|
3
16
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A helper function to deep merge objects and array.
|
|
3
|
+
*
|
|
4
|
+
* [](https://github.com/faasjs/faasjs/blob/main/packages/faasjs/deep_merge/LICENSE)
|
|
5
|
+
* [](https://www.npmjs.com/package/@faasjs/deep_merge)
|
|
6
|
+
*
|
|
7
|
+
* ## Install
|
|
8
|
+
*
|
|
9
|
+
* ```sh
|
|
10
|
+
* npm install @faasjs/deep_merge
|
|
11
|
+
* ```
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
1
14
|
/**
|
|
2
15
|
* Deep merge two objects or arrays.
|
|
3
16
|
*
|