@visulima/deep-clone 2.1.5 → 2.1.7
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/CHANGELOG.md +24 -0
- package/LICENSE.md +6 -0
- package/README.md +73 -73
- package/dist/handler.cjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/utils.cjs +1 -1
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
## @visulima/deep-clone [2.1.7](https://github.com/visulima/visulima/compare/@visulima/deep-clone@2.1.6...@visulima/deep-clone@2.1.7) (2024-12-12)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* added missing placeholder variables into LICENSE.md file ([cef32c6](https://github.com/visulima/visulima/commit/cef32c6eb19dc3215a835e848ef12223a8fa05e0))
|
|
6
|
+
* allow node v23 ([8ca929a](https://github.com/visulima/visulima/commit/8ca929af311ce8036cbbfde68b6db05381b860a5))
|
|
7
|
+
* allowed node 23, updated dev dependencies ([f99d34e](https://github.com/visulima/visulima/commit/f99d34e01f6b13be8586a1b5d37dc8b8df0a5817))
|
|
8
|
+
* updated packem to v1.8.2 ([23f869b](https://github.com/visulima/visulima/commit/23f869b4120856cc97e2bffa6d508e2ae30420ea))
|
|
9
|
+
* updated packem to v1.9.2 ([47bdc2d](https://github.com/visulima/visulima/commit/47bdc2dfaeca4e7014dbe7772eae2fdf8c8b35bb))
|
|
10
|
+
|
|
11
|
+
### Styles
|
|
12
|
+
|
|
13
|
+
* cs fixes ([46d31e0](https://github.com/visulima/visulima/commit/46d31e082e1865262bf380859c14fabd28ff456d))
|
|
14
|
+
|
|
15
|
+
### Miscellaneous Chores
|
|
16
|
+
|
|
17
|
+
* updated dev dependencies ([a916944](https://github.com/visulima/visulima/commit/a916944b888bb34c34b0c54328b38d29e4399857))
|
|
18
|
+
|
|
19
|
+
## @visulima/deep-clone [2.1.6](https://github.com/visulima/visulima/compare/@visulima/deep-clone@2.1.5...@visulima/deep-clone@2.1.6) (2024-10-05)
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* updated dev dependencies, updated packem to v1.0.7, fixed naming of some lint config files ([c071a9c](https://github.com/visulima/visulima/commit/c071a9c8e129014a962ff654a16f302ca18a5c67))
|
|
24
|
+
|
|
1
25
|
## @visulima/deep-clone [2.1.5](https://github.com/visulima/visulima/compare/@visulima/deep-clone@2.1.4...@visulima/deep-clone@2.1.5) (2024-09-24)
|
|
2
26
|
|
|
3
27
|
### Bug Fixes
|
package/LICENSE.md
CHANGED
|
@@ -19,3 +19,9 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
<!-- DEPENDENCIES -->
|
|
24
|
+
<!-- /DEPENDENCIES -->
|
|
25
|
+
|
|
26
|
+
<!-- TYPE_DEPENDENCIES -->
|
|
27
|
+
<!-- /TYPE_DEPENDENCIES -->
|
package/README.md
CHANGED
|
@@ -79,24 +79,24 @@ Type: `object`
|
|
|
79
79
|
|
|
80
80
|
A set of custom handlers for specific type of value. Each handler is a function that takes the original value and returns a new value or throws an error if the value is not supported.
|
|
81
81
|
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
82
|
+
- Array: InternalHandler<unknown[]>;
|
|
83
|
+
- ArrayBuffer: InternalHandler<ArrayBuffer>;
|
|
84
|
+
- Blob: InternalHandler<Blob>;
|
|
85
|
+
- DataView: InternalHandler<DataView>;
|
|
86
|
+
- Date: InternalHandler<Date>;
|
|
87
|
+
- Error: InternalHandler<Error>;
|
|
88
|
+
- Float32Array: InternalHandler<Float32Array>;
|
|
89
|
+
- Float64Array: InternalHandler<Float64Array>;
|
|
90
|
+
- Int8Array: InternalHandler<Int8Array>;
|
|
91
|
+
- Int16Array: InternalHandler<Int16Array>;
|
|
92
|
+
- Int32Array: InternalHandler<Int32Array>;
|
|
93
|
+
- Map: InternalHandler<Map<unknown, unknown>>;
|
|
94
|
+
- Object: InternalHandler<Record<string, unknown>>;
|
|
95
|
+
- Promise: InternalHandler<Promise<unknown>>;
|
|
96
|
+
- RegExp: InternalHandler<RegExp>;
|
|
97
|
+
- Set: InternalHandler<Set<unknown>>;
|
|
98
|
+
- WeakMap: InternalHandler<WeakMap<any, unknown>>;
|
|
99
|
+
- WeakSet: InternalHandler<WeakSet<any>>;
|
|
100
100
|
|
|
101
101
|
## Utils
|
|
102
102
|
|
|
@@ -130,59 +130,59 @@ console.log(clean); // => {}
|
|
|
130
130
|
|
|
131
131
|
## Notes
|
|
132
132
|
|
|
133
|
-
-
|
|
134
|
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
-
|
|
144
|
-
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
-
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
164
|
-
-
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
|
|
168
|
-
-
|
|
169
|
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
172
|
-
-
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
-
|
|
176
|
-
-
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
-
|
|
133
|
+
- List of **supported** values/types:
|
|
134
|
+
|
|
135
|
+
- `undefined` (original value is returned)
|
|
136
|
+
- `null` (original value is returned)
|
|
137
|
+
- `boolean`/`Boolean` (original value is returned)
|
|
138
|
+
- `string`/`String` (original value is returned)
|
|
139
|
+
- `number`/`Number` (original value is returned)
|
|
140
|
+
- `function`
|
|
141
|
+
- `Object`
|
|
142
|
+
- `Date`
|
|
143
|
+
- `RegExp`
|
|
144
|
+
- `Set`
|
|
145
|
+
- `Map`
|
|
146
|
+
- [`Error`][mdn-error]
|
|
147
|
+
- [`URIError`][mdn-uri-error]
|
|
148
|
+
- [`ReferenceError`][mdn-reference-error]
|
|
149
|
+
- [`SyntaxError`][mdn-syntax-error]
|
|
150
|
+
- [`RangeError`][mdn-range-error]
|
|
151
|
+
- [`EvalError`][mdn-eval-error]
|
|
152
|
+
- [`TypeError`][mdn-type-error]
|
|
153
|
+
- [`System Error`][node-system-error] (Node.js)
|
|
154
|
+
- `Array`
|
|
155
|
+
- `Int8Array`
|
|
156
|
+
- `Uint8Array`
|
|
157
|
+
- `Uint8ClampedArray`
|
|
158
|
+
- `Init16Array`
|
|
159
|
+
- `Uint16Array`
|
|
160
|
+
- `Int32Array`
|
|
161
|
+
- `Uint32Array`
|
|
162
|
+
- `Float32Array`
|
|
163
|
+
- `Float64Array`
|
|
164
|
+
- `Buffer` ([Node.js][node-buffer])
|
|
165
|
+
- `DataView`
|
|
166
|
+
- `Blob`
|
|
167
|
+
|
|
168
|
+
- List of **unsupported** values/types:
|
|
169
|
+
|
|
170
|
+
- `DOMElement`: to copy DOM elements, use `element.cloneNode()`.
|
|
171
|
+
- `Symbol`
|
|
172
|
+
- `WeakMap`
|
|
173
|
+
- `WeakSet`
|
|
174
|
+
- `File`
|
|
175
|
+
- `FileList`
|
|
176
|
+
- `ImageData`
|
|
177
|
+
- `ImageBitmap`
|
|
178
|
+
- `Promise`
|
|
179
|
+
- `SharedArrayBuffer`
|
|
180
|
+
|
|
181
|
+
- The implementation **can** handle circular references.
|
|
182
|
+
- If a `Number`, `String`, or `Boolean` object is encountered, the value is cloned as a **primitive**. This behavior is intentional. The implementation is opinionated in wanting to **avoid** creating `numbers`, `strings`, and `booleans` via the `new` operator and a constructor.
|
|
183
|
+
- The implementation **only** checks whether basic `Objects`, `Arrays`, and class instances are `extensible`, `sealed`, and/or `frozen`.
|
|
184
|
+
- `functions` are **not** cloned; their reference is copied.
|
|
185
|
+
- The implementation supports custom [`error`][mdn-error] types which are [`Error`][mdn-error] instances (e.g., ES2015 subclasses).
|
|
186
186
|
|
|
187
187
|
## Benchmarks
|
|
188
188
|
|
|
@@ -207,8 +207,8 @@ If you would like to help take a look at the [list of issues](https://github.com
|
|
|
207
207
|
|
|
208
208
|
## Credits
|
|
209
209
|
|
|
210
|
-
-
|
|
211
|
-
-
|
|
210
|
+
- [Daniel Bannert](https://github.com/prisis)
|
|
211
|
+
- [All Contributors](https://github.com/visulima/visulima/graphs/contributors)
|
|
212
212
|
|
|
213
213
|
## License
|
|
214
214
|
|
package/dist/handler.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./packem_shared/copyArrayLoose-ukX__AC4.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./packem_shared/copyArrayLoose-ukX__AC4.cjs"),y=require("./packem_shared/copyArrayBuffer-CErFt6r1.cjs"),t=require("./packem_shared/copyBlob-CCIQ88PB.cjs"),i=require("./packem_shared/copyDataView-C9SuIdXo.cjs"),a=require("./packem_shared/copyDate-CfZZ3WAO.cjs"),s=require("./packem_shared/copyError-DGbUXsSU.cjs"),e=require("./packem_shared/copyMapLoose-CuTK-fBO.cjs"),r=require("./packem_shared/copyObjectLoose-CbVJDz5e.cjs"),c=require("./packem_shared/copyRegExpLoose-DzJvEX_n.cjs"),p=require("./packem_shared/copySetLoose-v1Cjaq91.cjs");exports.copyArrayLoose=o.copyArrayLoose;exports.copyArrayStrict=o.copyArrayStrict;exports.copyArrayBuffer=y;exports.copyBlob=t;exports.copyDataView=i;exports.copyDate=a;exports.copyError=s;exports.copyMapLoose=e.copyMapLoose;exports.copyMapStrict=e.copyMapStrict;exports.copyObjectLoose=r.copyObjectLoose;exports.copyObjectStrict=r.copyObjectStrict;exports.copyRegExpLoose=c.copyRegExpLoose;exports.copyRegExpStrict=c.copyRegExpStrict;exports.copySetLoose=p.copySetLoose;exports.copySetStrict=p.copySetStrict;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var d=Object.defineProperty;var f=(t,
|
|
1
|
+
"use strict";var d=Object.defineProperty;var f=(t,n)=>d(t,"name",{value:n,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./packem_shared/copyArrayLoose-ukX__AC4.cjs"),S=require("./packem_shared/copyArrayBuffer-CErFt6r1.cjs"),j=require("./packem_shared/copyBlob-CCIQ88PB.cjs"),E=require("./packem_shared/copyDataView-C9SuIdXo.cjs"),w=require("./packem_shared/copyDate-CfZZ3WAO.cjs"),h=require("./packem_shared/copyError-DGbUXsSU.cjs"),u=require("./packem_shared/copyMapLoose-CuTK-fBO.cjs"),s=require("./packem_shared/copyObjectLoose-CbVJDz5e.cjs"),l=require("./packem_shared/copyRegExpLoose-DzJvEX_n.cjs"),b=require("./packem_shared/copySetLoose-v1Cjaq91.cjs");var M=Object.defineProperty,a=f((t,n)=>M(t,"name",{value:n,configurable:!0}),"t");const y=a(t=>typeof t=="object"&&t!==null||typeof t=="function","canValueHaveProperties"),B={Array:p.copyArrayLoose,ArrayBuffer:S,Blob:j,DataView:E,Date:w,Error:h,Function:a((t,n)=>t,"Function"),Map:u.copyMapLoose,Object:s.copyObjectLoose,Promise:a(t=>{throw new TypeError(`${t.constructor.name} objects cannot be cloned`)},"Promise"),RegExp:l.copyRegExpLoose,Set:b.copySetLoose,SharedArrayBuffer:a((t,n)=>{throw new TypeError(`${t.constructor.name} objects cannot be cloned`)},"SharedArrayBuffer"),WeakMap:a(t=>{throw new TypeError(`${t.constructor.name} objects cannot be cloned`)},"WeakMap"),WeakSet:a(t=>{throw new TypeError(`${t.constructor.name} objects cannot be cloned`)},"WeakSet")},g=a((t,n)=>{if(!y(t))return t;const o={...B,...n?.strict?{Array:p.copyArrayStrict,Map:u.copyMapStrict,Object:s.copyObjectStrict,RegExp:l.copyRegExpStrict,Set:b.copySetStrict}:{},...n?.handler};let c=new WeakMap;const i=a((e,r)=>{if(!y(e))return e;if(r.cache.has(e))return r.cache.get(e);if(Array.isArray(e))return o.Array(e,r);if(typeof e=="object"&&e.constructor===Object&&e.nodeType===void 0)return o.Object(e,r);if(e.nodeType!==void 0&&e.cloneNode!==void 0)return e.cloneNode(!0);if(e instanceof Date)return o.Date(e,r);if(e instanceof RegExp)return o.RegExp(e,r);if(e instanceof Map)return o.Map(e,r);if(e instanceof Set)return o.Set(e,r);if(e instanceof Error)return o.Error(e,r);if(e instanceof ArrayBuffer||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Uint32Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array)return o.ArrayBuffer(e,r);if(e instanceof Blob)return o.Blob(e,r);if(e instanceof DataView)return o.DataView(e,r);if(e instanceof SharedArrayBuffer)return o.SharedArrayBuffer(e,r);if(e instanceof Promise)return o.Promise(e,r);if(e instanceof WeakMap)return o.WeakMap(e,r);if(e instanceof WeakSet)return o.WeakSet(e,r);if(e instanceof Function)return o.Function(e,r);if(typeof e=="object")return o.Object(e,r);throw new TypeError(`Type of ${typeof e} cannot be cloned`,e)},"clone"),A=i(t,{cache:c,clone:i});return c=null,A},"deepClone");exports.deepClone=g;
|
package/dist/utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./packem_shared/copyOwnProperties-Zk6Vg6Oe.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./packem_shared/copyOwnProperties-Zk6Vg6Oe.cjs"),r=require("./packem_shared/getCleanClone-DLZ_E9xd.cjs");exports.copyOwnProperties=e;exports.getCleanClone=r;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/deep-clone",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.7",
|
|
4
4
|
"description": "Fastest deep clone implementation.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -118,18 +118,18 @@
|
|
|
118
118
|
"devDependencies": {
|
|
119
119
|
"@anolilab/eslint-config": "^15.0.3",
|
|
120
120
|
"@anolilab/prettier-config": "^5.0.14",
|
|
121
|
-
"@anolilab/semantic-release-pnpm": "^1.1.
|
|
122
|
-
"@anolilab/semantic-release-preset": "^9.0.
|
|
123
|
-
"@arethetypeswrong/cli": "^0.
|
|
121
|
+
"@anolilab/semantic-release-pnpm": "^1.1.5",
|
|
122
|
+
"@anolilab/semantic-release-preset": "^9.0.2",
|
|
123
|
+
"@arethetypeswrong/cli": "^0.17.1",
|
|
124
124
|
"@mfederczuk/deeptools": "2.1.0-indev01",
|
|
125
125
|
"@rushstack/eslint-plugin-security": "^0.8.3",
|
|
126
126
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
127
127
|
"@types/lodash.clonedeep": "^4.5.9",
|
|
128
128
|
"@types/node": "18.19.15",
|
|
129
|
-
"@ungap/structured-clone": "^1.2.
|
|
130
|
-
"@visulima/packem": "1.
|
|
131
|
-
"@vitest/coverage-v8": "^2.1.
|
|
132
|
-
"@vitest/ui": "^2.1.
|
|
129
|
+
"@ungap/structured-clone": "^1.2.1",
|
|
130
|
+
"@visulima/packem": "1.9.2",
|
|
131
|
+
"@vitest/coverage-v8": "^2.1.8",
|
|
132
|
+
"@vitest/ui": "^2.1.8",
|
|
133
133
|
"clone-deep": "^4.0.1",
|
|
134
134
|
"conventional-changelog-conventionalcommits": "8.0.0",
|
|
135
135
|
"cross-env": "^7.0.3",
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"eslint-plugin-etc": "^2.0.3",
|
|
141
141
|
"eslint-plugin-import": "npm:eslint-plugin-i@^2.29.1",
|
|
142
142
|
"eslint-plugin-mdx": "^3.1.5",
|
|
143
|
-
"eslint-plugin-tsdoc": "^0.
|
|
143
|
+
"eslint-plugin-tsdoc": "^0.4.0",
|
|
144
144
|
"eslint-plugin-vitest": "^0.4.1",
|
|
145
145
|
"eslint-plugin-vitest-globals": "^1.5.0",
|
|
146
146
|
"fast-copy": "^3.0.2",
|
|
@@ -149,17 +149,17 @@
|
|
|
149
149
|
"nano-copy": "^0.1.1",
|
|
150
150
|
"nanoclone": "^1.0.2",
|
|
151
151
|
"plain-object-clone": "^2.0.0",
|
|
152
|
-
"prettier": "^3.
|
|
152
|
+
"prettier": "^3.4.2",
|
|
153
153
|
"ramda": "^0.30.1",
|
|
154
154
|
"rfdc": "^1.4.1",
|
|
155
155
|
"rimraf": "5.0.9",
|
|
156
156
|
"semantic-release": "24.0.0",
|
|
157
157
|
"standard": "^17.1.2",
|
|
158
158
|
"typescript": "5.4.5",
|
|
159
|
-
"vitest": "^2.1.
|
|
159
|
+
"vitest": "^2.1.8"
|
|
160
160
|
},
|
|
161
161
|
"engines": {
|
|
162
|
-
"node": ">=18.* <=
|
|
162
|
+
"node": ">=18.* <=23.*"
|
|
163
163
|
},
|
|
164
164
|
"os": [
|
|
165
165
|
"darwin",
|