@faasjs/deep_merge 0.0.2-beta.362 → 0.0.2-beta.366

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 CHANGED
@@ -1,16 +1,20 @@
1
1
  # @faasjs/deep_merge
2
2
 
3
- 合并对象
4
-
5
3
  [![License: MIT](https://img.shields.io/npm/l/@faasjs/deep_merge.svg)](https://github.com/faasjs/faasjs/blob/main/packages/faasjs/deep_merge/LICENSE)
6
4
  [![NPM Stable Version](https://img.shields.io/npm/v/@faasjs/deep_merge/stable.svg)](https://www.npmjs.com/package/@faasjs/deep_merge)
7
5
  [![NPM Beta Version](https://img.shields.io/npm/v/@faasjs/deep_merge/beta.svg)](https://www.npmjs.com/package/@faasjs/deep_merge)
8
6
 
7
+ A helper function to deep merge objects and array.
8
+
9
+ ## Install
10
+
11
+ npm install @faasjs/deep_merge
12
+
9
13
  ## Modules
10
14
 
11
15
  ### Functions
12
16
 
13
- - [deepMerge](modules.md#deepmerge)
17
+ - [deepMerge](#deepmerge)
14
18
 
15
19
  ## Functions
16
20
 
@@ -18,19 +22,23 @@
18
22
 
19
23
  ▸ **deepMerge**(...`sources`): `any`
20
24
 
21
- 合并对象
25
+ Deep merge two objects or arrays.
26
+
27
+ Features:
28
+ * All objects will be cloned before merging.
29
+ * Merging order is from right to left.
30
+ * If an array include same objects, it will be unique to one.
22
31
 
23
- **`description`**
24
- 注意事项:
25
- * 合并时会复制对象,不会修改原对象
26
- * 合并顺序是后面的覆盖前面的
27
- * 若有数组形式的属性,数组里的内容将被去重合并
32
+ ```ts
33
+ deepMerge({ a: 1 }, { a: 2 }) // { a: 2 }
34
+ deepMerge([1, 2], [2, 3]) // [1, 2, 3]
35
+ ```
28
36
 
29
37
  #### Parameters
30
38
 
31
- | Name | Type | Description |
32
- | :------ | :------ | :------ |
33
- | `...sources` | `any`[] | 合并对象 |
39
+ | Name | Type |
40
+ | :------ | :------ |
41
+ | `...sources` | `any`[] |
34
42
 
35
43
  #### Returns
36
44
 
package/dist/index.d.ts CHANGED
@@ -1,11 +1,15 @@
1
1
  /**
2
- * 合并对象
3
- * @description
4
- * 注意事项:
5
- * * 合并时会复制对象,不会修改原对象
6
- * * 合并顺序是后面的覆盖前面的
7
- * * 若有数组形式的属性,数组里的内容将被去重合并
8
- * @param sources [...any] 合并对象
2
+ * Deep merge two objects or arrays.
3
+ *
4
+ * Features:
5
+ * * All objects will be cloned before merging.
6
+ * * Merging order is from right to left.
7
+ * * If an array include same objects, it will be unique to one.
8
+ *
9
+ * ```ts
10
+ * deepMerge({ a: 1 }, { a: 2 }) // { a: 2 }
11
+ * deepMerge([1, 2], [2, 3]) // [1, 2, 3]
12
+ * ```
9
13
  */
10
14
  declare function deepMerge(...sources: any[]): any;
11
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@faasjs/deep_merge",
3
- "version": "0.0.2-beta.362",
3
+ "version": "0.0.2-beta.366",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",