bunshin-clone 1.0.13 → 1.1.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/dist/index.cjs +8 -11
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -11
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -71,17 +71,14 @@ function clone(node, options, refs) {
|
|
|
71
71
|
if (ArrayBuffer.isView(node)) {
|
|
72
72
|
const { buffer, byteOffset, byteLength } = node;
|
|
73
73
|
if (node instanceof DataView) {
|
|
74
|
-
const
|
|
75
|
-
refs.set(node,
|
|
76
|
-
return
|
|
77
|
-
} else {
|
|
78
|
-
const Ctor = node.constructor;
|
|
79
|
-
const result = new Ctor(
|
|
80
|
-
buffer.slice(byteOffset, byteOffset + byteLength)
|
|
81
|
-
);
|
|
82
|
-
refs.set(node, result);
|
|
83
|
-
return result;
|
|
74
|
+
const result2 = new DataView(buffer.slice(0), byteOffset, byteLength);
|
|
75
|
+
refs.set(node, result2);
|
|
76
|
+
return result2;
|
|
84
77
|
}
|
|
78
|
+
const Ctor = node.constructor;
|
|
79
|
+
const result = new Ctor(buffer.slice(byteOffset, byteOffset + byteLength));
|
|
80
|
+
refs.set(node, result);
|
|
81
|
+
return result;
|
|
85
82
|
}
|
|
86
83
|
if (node instanceof Error || typeof DOMException !== "undefined" && node instanceof DOMException) {
|
|
87
84
|
return cloneError(node, options, refs);
|
|
@@ -212,7 +209,7 @@ function isUnsafeKey(key) {
|
|
|
212
209
|
* High-performance deep clone utility with descriptor support.
|
|
213
210
|
* Handles circular ref and complex built-in types.
|
|
214
211
|
*
|
|
215
|
-
* @version 1.0
|
|
212
|
+
* @version 1.1.0
|
|
216
213
|
* @author Yusuke Kamiyamane
|
|
217
214
|
* @license MIT
|
|
218
215
|
* @copyright Copyright (c) 2026 Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -69,17 +69,14 @@ function clone(node, options, refs) {
|
|
|
69
69
|
if (ArrayBuffer.isView(node)) {
|
|
70
70
|
const { buffer, byteOffset, byteLength } = node;
|
|
71
71
|
if (node instanceof DataView) {
|
|
72
|
-
const
|
|
73
|
-
refs.set(node,
|
|
74
|
-
return
|
|
75
|
-
} else {
|
|
76
|
-
const Ctor = node.constructor;
|
|
77
|
-
const result = new Ctor(
|
|
78
|
-
buffer.slice(byteOffset, byteOffset + byteLength)
|
|
79
|
-
);
|
|
80
|
-
refs.set(node, result);
|
|
81
|
-
return result;
|
|
72
|
+
const result2 = new DataView(buffer.slice(0), byteOffset, byteLength);
|
|
73
|
+
refs.set(node, result2);
|
|
74
|
+
return result2;
|
|
82
75
|
}
|
|
76
|
+
const Ctor = node.constructor;
|
|
77
|
+
const result = new Ctor(buffer.slice(byteOffset, byteOffset + byteLength));
|
|
78
|
+
refs.set(node, result);
|
|
79
|
+
return result;
|
|
83
80
|
}
|
|
84
81
|
if (node instanceof Error || typeof DOMException !== "undefined" && node instanceof DOMException) {
|
|
85
82
|
return cloneError(node, options, refs);
|
|
@@ -210,7 +207,7 @@ function isUnsafeKey(key) {
|
|
|
210
207
|
* High-performance deep clone utility with descriptor support.
|
|
211
208
|
* Handles circular ref and complex built-in types.
|
|
212
209
|
*
|
|
213
|
-
* @version 1.0
|
|
210
|
+
* @version 1.1.0
|
|
214
211
|
* @author Yusuke Kamiyamane
|
|
215
212
|
* @license MIT
|
|
216
213
|
* @copyright Copyright (c) 2026 Yusuke Kamiyamane
|