sculp-js 1.17.1 → 1.17.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.
Files changed (62) hide show
  1. package/README.md +93 -107
  2. package/dist/cjs/array.js +8 -8
  3. package/dist/cjs/async.js +1 -1
  4. package/dist/cjs/base64.js +1 -1
  5. package/dist/cjs/clipboard.js +1 -1
  6. package/dist/cjs/cloneDeep.js +1 -1
  7. package/dist/cjs/cookie.js +1 -1
  8. package/dist/cjs/date.js +1 -1
  9. package/dist/cjs/dom.js +1 -1
  10. package/dist/cjs/download.js +1 -1
  11. package/dist/cjs/file.js +1 -1
  12. package/dist/cjs/func.js +1 -1
  13. package/dist/cjs/index.js +1 -1
  14. package/dist/cjs/isEqual.js +1 -1
  15. package/dist/cjs/math.js +1 -1
  16. package/dist/cjs/number.js +1 -1
  17. package/dist/cjs/object.js +1 -1
  18. package/dist/cjs/path.js +1 -1
  19. package/dist/cjs/qs.js +1 -1
  20. package/dist/cjs/random.js +1 -1
  21. package/dist/cjs/string.js +1 -1
  22. package/dist/cjs/tooltip.js +1 -1
  23. package/dist/cjs/tree.js +1 -1
  24. package/dist/cjs/type.js +1 -1
  25. package/dist/cjs/unique.js +1 -1
  26. package/dist/cjs/url.js +1 -1
  27. package/dist/cjs/validator.js +1 -1
  28. package/dist/cjs/variable.js +1 -1
  29. package/dist/cjs/watermark.js +1 -1
  30. package/dist/esm/array.js +8 -8
  31. package/dist/esm/async.js +1 -1
  32. package/dist/esm/base64.js +1 -1
  33. package/dist/esm/clipboard.js +1 -1
  34. package/dist/esm/cloneDeep.js +1 -1
  35. package/dist/esm/cookie.js +1 -1
  36. package/dist/esm/date.js +1 -1
  37. package/dist/esm/dom.js +1 -1
  38. package/dist/esm/download.js +1 -1
  39. package/dist/esm/file.js +1 -1
  40. package/dist/esm/func.js +1 -1
  41. package/dist/esm/index.js +1 -1
  42. package/dist/esm/isEqual.js +1 -1
  43. package/dist/esm/math.js +1 -1
  44. package/dist/esm/number.js +1 -1
  45. package/dist/esm/object.js +1 -1
  46. package/dist/esm/path.js +1 -1
  47. package/dist/esm/qs.js +1 -1
  48. package/dist/esm/random.js +1 -1
  49. package/dist/esm/string.js +1 -1
  50. package/dist/esm/tooltip.js +1 -1
  51. package/dist/esm/tree.js +1 -1
  52. package/dist/esm/type.js +1 -1
  53. package/dist/esm/unique.js +1 -1
  54. package/dist/esm/url.js +1 -1
  55. package/dist/esm/validator.js +1 -1
  56. package/dist/esm/variable.js +1 -1
  57. package/dist/esm/watermark.js +1 -1
  58. package/dist/sculp-js.d.ts +1471 -0
  59. package/dist/types/array.d.ts +6 -6
  60. package/dist/types/tsdoc-metadata.json +11 -0
  61. package/dist/umd/index.min.js +2 -2
  62. package/package.json +14 -3
package/README.md CHANGED
@@ -1,150 +1,136 @@
1
- [![Node.js CI](https://github.com/chandq/sculp-js/actions/workflows/node.js.yml/badge.svg)](https://github.com/chandq/sculp-js/actions/workflows/node.js.yml)
2
- [![sculp-js](https://img.shields.io/github/package-json/v/chandq/sculp-js?style=flat-square)](https://www.npmjs.com/package/sculp-js)
3
-
4
- [![license:MIT](https://img.shields.io/npm/l/vue.svg?sanitize=true)](https://github.com/chandq/sculp-js/blob/main/LICENSE.md)
5
- [![Downloads:?](https://img.shields.io/npm/dm/sculp-js.svg?sanitize=true)](https://npmcharts.com/compare/sculp-js?minimal=true)
6
- [![codecov](https://codecov.io/gh/chandq/sculp-js/graph/badge.svg?token=VZ6TERPGI9)](https://codecov.io/gh/chandq/sculp-js)
1
+ <div align="center">
7
2
 
8
3
  # sculp-js
9
4
 
10
- [API Doc](https://chandq.github.io/sculp-js/)
11
-
12
- > TS + Rollup, native implementation, without relying on any third-party libraries, outputs products of three module modes: ESM, CJS, and UMD. sculp-js only used to Web environment, @sculp/core can be used to Web、Node.js、Mini Program.
13
-
14
- ## Quickstart
5
+ **A Modern JavaScript Utility Library for Web**
15
6
 
16
- - Via CDN: `<script src="https://unpkg.com/sculp-js"></script>`
17
- - Via npm:
18
-
19
- ```js
20
- npm i sculp-js
21
- ```
22
-
23
- ## Features
24
-
25
- - Type
26
-
27
- - isString
28
- - isBoolean
29
- - isNumber
30
- - isUndefined
31
- - isNull
32
- - isNullish
33
- - isPrimitive
34
- - isFunction
35
- - isObject
36
- - isArray
37
- - typeIs
38
- - isJsonString
39
- - isEmpty
7
+ [![Node.js CI](https://github.com/chandq/sculp-js/actions/workflows/node.js.yml/badge.svg)](https://github.com/chandq/sculp-js/actions/workflows/node.js.yml)
8
+ [![sculp-js](https://img.shields.io/github/package-json/v/chandq/sculp-js?style=flat-square)](https://www.npmjs.com/package/sculp-js)
9
+ [![license:MIT](https://img.shields.io/npm/l/vue.svg?sanitize=true)](https://github.com/chandq/sculp-js/blob/main/LICENSE.md)
10
+ [![codecov](https://codecov.io/gh/chandq/sculp-js/graph/badge.svg?token=VZ6TERPGI9)](https://codecov.io/gh/chandq/sculp-js)
40
11
 
41
- - encode/decode
12
+ </div>
42
13
 
43
- - weAtob
44
- - weBtoa
14
+ <br/>
45
15
 
46
- - Array
16
+ > A lightweight utility library written in TypeScript with zero dependencies, supporting ESM, CJS, and UMD formats.
47
17
 
48
- - arrayEach
49
- - arrayEachAsync
18
+ **[API Documentation](https://chandq.github.io/sculp-js/)** • **[Getting Started](#usage)** • **[Features](#features)**
50
19
 
51
- - Tree
20
+ ## ✨ Features
52
21
 
53
- - forEachDeep
54
- - mapDeep
55
- - findDeep
56
- - filterDeep
57
- - searchTreeById
58
- - formatTree
59
- - flatTree
60
- - fuzzySearchTree
22
+ - **Type-Safe**: Full TypeScript support with comprehensive type definitions
23
+ - **Zero Dependencies**: Pure native implementation, no external libraries
24
+ - **Tree Shaking**: Supports selective imports for smaller bundle sizes
25
+ - **Multi-Format**: ESM, CJS, and UMD builds available
26
+ - **Web Focused**: Optimized for modern web environments
61
27
 
62
- - Object
28
+ ### Core Utilities
63
29
 
64
- - isPlainObject
65
- - objectHas
66
- - objectAssign
67
- - objectEach
68
- - objectEachAsync
69
- - objectGet
70
- - cloneDeep
30
+ <details>
31
+ <summary><strong>Type Checking</strong></summary>
71
32
 
72
- - Number
33
+ - `isString`, `isNumber`, `isBoolean`, `isFunction`, `isObject`, `isArray`
34
+ - `isDate`, `isRegExp`, `isUndefined`, `isNull`, `isError`, `isNaN`
35
+ - `isPrimitive`, `isSymbol`, `isBigInt`, `isPlainObject`
36
+ - `isEmpty`, `isNodeList`, `isValidDate`, `typeIs`
73
37
 
74
- - formatNumber
38
+ </details>
75
39
 
76
- - String
40
+ <details>
41
+ <summary><strong>Data Structures</strong></summary>
77
42
 
78
- - stringCamelCase
79
- - stringKebabCase
80
- - parseQueryParams
43
+ - **Array**: `arrayEach`, `arrayEachAsync`, `arrayInsertBefore`, `arrayRemove`
44
+ - **Tree**: `forEachDeep`, `mapDeep`, `findDeep`, `filterDeep`, `searchTreeById`, `flatTree`, `fuzzySearchTree`
45
+ - **Object**: `objectAssign`, `objectGet`, `objectHas`, `cloneDeep`, `objectPick`, `objectOmit`
81
46
 
82
- - Unique
47
+ </details>
83
48
 
84
- - uniqueString
85
- - uniqueNumber
49
+ <details>
50
+ <summary><strong>Web APIs</strong></summary>
86
51
 
87
- - Date
52
+ - **DOM**: `addClass`, `hasClass`, `removeClass`, `getStyle`, `setStyle`
53
+ - **File**: `chooseLocalFile`, `compressImg`
54
+ - **Clipboard**: `copyText`, `fallbackCopyText`
55
+ - **Download**: `downloadBlob`, `downloadURL`, `downloadData`
56
+ - **Watermark**: `genCanvasWM`
88
57
 
89
- - formatDate
90
- - dateToStart
91
- - dateToEnd
92
- - calculateDate
93
- - calculateDateTime
58
+ </details>
94
59
 
95
- - Download (web)
60
+ <details>
61
+ <summary><strong>Encoding & Validation</strong></summary>
96
62
 
97
- - downloadURL
98
- - downloadHref
99
- - downloadBlob
100
- - downloadData
63
+ - **Encode/Decode**: `weBtoa`, `weAtob`, `b64encode`, `b64decode`
64
+ - **Validation**: `isEmail`, `isPhone`, `isUrl`, `isIDNO`, `isIPv4`, `isIPv6`
101
65
 
102
- - File (web)
66
+ </details>
103
67
 
104
- - chooseLocalFile
105
- - compressImg
68
+ <details>
69
+ <summary><strong>Additional Utils</strong></summary>
106
70
 
107
- - Dom (web)
71
+ - **Date**: `formatDate`, `calculateDate`, `dateToStart`, `dateToEnd`
72
+ - **String**: `stringCamelCase`, `stringKebabCase`, `parseQueryParams`, `stringEscapeHTML`
73
+ - **Math**: `add`, `subtract`, `multiply`, `divide`, `numberAbbr`
74
+ - **Functional**: `debounce`, `throttle`, `once`, `wait`
108
75
 
109
- - hasClass
110
- - addClass
111
- - removeClass
112
- - setStyle
113
- - getStyle
114
- - getComputedCssVal
115
- - getStrWidthPx
76
+ </details>
116
77
 
117
- - Watermark (web)
78
+ ## 🚀 Installation
118
79
 
119
- - genCanvasWM
80
+ ### npm
120
81
 
121
- - Clipboard (web)
122
- - copyText
82
+ ```bash
83
+ npm install sculp-js
84
+ ```
123
85
 
124
- ## Install
86
+ ### CDN
125
87
 
126
- ```js
127
- npm i sculp-js
88
+ ```html
89
+ <script src="https://unpkg.com/sculp-js"></script>
128
90
  ```
129
91
 
130
- ## Usage
92
+ ## 💡 Usage
131
93
 
132
94
  ```js
133
- import { forEachDeep } from 'sculp-js';
95
+ import { forEachDeep, cloneDeep } from 'sculp-js';
134
96
 
97
+ // Deep traversal of tree structures
135
98
  const tree = [
136
- { id: 1, name: 'row1' },
137
99
  {
138
- id: 2,
139
- name: 'row2',
140
- children: [{ id: 21, name: 'row2-1' }]
100
+ id: 1,
101
+ name: 'Parent 1',
102
+ children: [
103
+ { id: 11, name: 'Child 1' },
104
+ { id: 12, name: 'Child 2', children: [{ id: 121, name: 'Grandchild 1' }] }
105
+ ]
141
106
  },
142
- { id: 3, name: 'row3' }
107
+ { id: 2, name: 'Parent 2' }
143
108
  ];
144
109
 
145
- const arr = [];
146
- forEachDeep(tree, ({ id, name }) => {
147
- arr.push(name);
110
+ const names = [];
111
+ forEachDeep(tree, item => {
112
+ names.push(item.name);
148
113
  });
149
- // arr will be: ['row1', 'row2', 'row2-1', 'row3'];
114
+ // names = ['Parent 1', 'Child 1', 'Child 2', 'Grandchild 1', 'Parent 2']
115
+
116
+ // Deep cloning of objects
117
+ const original = { a: 1, b: { c: 2 } };
118
+ const cloned = cloneDeep(original);
150
119
  ```
120
+
121
+ ## 📦 Module Formats
122
+
123
+ ```js
124
+ // ES Modules (recommended)
125
+ import { cloneDeep } from 'sculp-js';
126
+
127
+ // Individual module imports
128
+ import cloneDeep from 'sculp-js/cloneDeep';
129
+
130
+ // CommonJS
131
+ const { cloneDeep } = require('sculp-js');
132
+ ```
133
+
134
+ ## 📄 License
135
+
136
+ MIT License © 2023-present, [chandq](https://github.com/chandq)
package/dist/cjs/array.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -98,7 +98,7 @@ function arrayRemove(array, expect) {
98
98
  return array;
99
99
  }
100
100
  /**
101
- * Compare source array and target array, return diff result (add / delete).
101
+ * Compare source array and target array, return diff result (added / removed).
102
102
  *
103
103
  * - If `getKey` is not provided:
104
104
  * - Primitive values (string | number | symbol) will be used as keys directly.
@@ -115,13 +115,13 @@ function arrayRemove(array, expect) {
115
115
  * @example
116
116
  * ```ts
117
117
  * diffArray([1, 2, 3], [2, 3, 4])
118
- * // => { add: [4], delete: [1] }
118
+ * // => { added: [4], removed: [1] }
119
119
  * ```
120
120
  *
121
121
  * @example
122
122
  * ```ts
123
123
  * diffArray(['a', 'b'], ['b', 'c'])
124
- * // => { add: ['c'], delete: ['a'] }
124
+ * // => { added: ['c'], removed: ['a'] }
125
125
  * ```
126
126
  *
127
127
  * @example
@@ -131,7 +131,7 @@ function arrayRemove(array, expect) {
131
131
  * [{ id: 2 }, { id: 3 }],
132
132
  * item => item.id
133
133
  * )
134
- * // => { add: [{ id: 3 }], delete: [{ id: 1 }] }
134
+ * // => { added: [{ id: 3 }], removed: [{ id: 1 }] }
135
135
  * ```
136
136
  */
137
137
  function diffArray(source, target, getKey) {
@@ -150,11 +150,11 @@ function diffArray(source, target, getKey) {
150
150
  for (const item of target) {
151
151
  targetMap.set(resolveKey(item), item);
152
152
  }
153
- const add = [];
153
+ const added = [];
154
154
  const del = [];
155
155
  for (const [key, item] of targetMap) {
156
156
  if (!sourceMap.has(key)) {
157
- add.push(item);
157
+ added.push(item);
158
158
  }
159
159
  }
160
160
  for (const [key, item] of sourceMap) {
@@ -162,7 +162,7 @@ function diffArray(source, target, getKey) {
162
162
  del.push(item);
163
163
  }
164
164
  }
165
- return { add, delete: del };
165
+ return { added, removed: del };
166
166
  }
167
167
 
168
168
  exports.arrayEach = arrayEach;
package/dist/cjs/async.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/date.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/dom.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/file.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/func.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/math.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/path.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/qs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/tree.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/type.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/cjs/url.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/array.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -96,7 +96,7 @@ function arrayRemove(array, expect) {
96
96
  return array;
97
97
  }
98
98
  /**
99
- * Compare source array and target array, return diff result (add / delete).
99
+ * Compare source array and target array, return diff result (added / removed).
100
100
  *
101
101
  * - If `getKey` is not provided:
102
102
  * - Primitive values (string | number | symbol) will be used as keys directly.
@@ -113,13 +113,13 @@ function arrayRemove(array, expect) {
113
113
  * @example
114
114
  * ```ts
115
115
  * diffArray([1, 2, 3], [2, 3, 4])
116
- * // => { add: [4], delete: [1] }
116
+ * // => { added: [4], removed: [1] }
117
117
  * ```
118
118
  *
119
119
  * @example
120
120
  * ```ts
121
121
  * diffArray(['a', 'b'], ['b', 'c'])
122
- * // => { add: ['c'], delete: ['a'] }
122
+ * // => { added: ['c'], removed: ['a'] }
123
123
  * ```
124
124
  *
125
125
  * @example
@@ -129,7 +129,7 @@ function arrayRemove(array, expect) {
129
129
  * [{ id: 2 }, { id: 3 }],
130
130
  * item => item.id
131
131
  * )
132
- * // => { add: [{ id: 3 }], delete: [{ id: 1 }] }
132
+ * // => { added: [{ id: 3 }], removed: [{ id: 1 }] }
133
133
  * ```
134
134
  */
135
135
  function diffArray(source, target, getKey) {
@@ -148,11 +148,11 @@ function diffArray(source, target, getKey) {
148
148
  for (const item of target) {
149
149
  targetMap.set(resolveKey(item), item);
150
150
  }
151
- const add = [];
151
+ const added = [];
152
152
  const del = [];
153
153
  for (const [key, item] of targetMap) {
154
154
  if (!sourceMap.has(key)) {
155
- add.push(item);
155
+ added.push(item);
156
156
  }
157
157
  }
158
158
  for (const [key, item] of sourceMap) {
@@ -160,7 +160,7 @@ function diffArray(source, target, getKey) {
160
160
  del.push(item);
161
161
  }
162
162
  }
163
- return { add, delete: del };
163
+ return { added, removed: del };
164
164
  }
165
165
 
166
166
  export { arrayEach, arrayEachAsync, arrayInsertBefore, arrayRemove, diffArray };
package/dist/esm/async.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/date.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/dom.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */
package/dist/esm/file.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * sculp-js v1.17.1
2
+ * sculp-js v1.17.3
3
3
  * (c) 2023-present chandq
4
4
  * Released under the MIT License.
5
5
  */