bunshin-clone 1.0.9 → 1.0.10
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 +9 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -149,11 +149,17 @@ function cloneError(value, options, ref) {
|
|
|
149
149
|
result.name = name;
|
|
150
150
|
}
|
|
151
151
|
ref.set(value, result);
|
|
152
|
+
if (value.stack) {
|
|
153
|
+
try {
|
|
154
|
+
result.stack = value.stack;
|
|
155
|
+
} catch {
|
|
156
|
+
}
|
|
157
|
+
}
|
|
152
158
|
if ("cause" in value && value.cause !== void 0) {
|
|
153
159
|
result.cause = clone(value.cause, options, ref);
|
|
154
160
|
}
|
|
155
|
-
|
|
156
|
-
result
|
|
161
|
+
for (const key of Object.keys(value)) {
|
|
162
|
+
result[key] = clone(value[key], options, ref);
|
|
157
163
|
}
|
|
158
164
|
return result;
|
|
159
165
|
}
|
|
@@ -213,7 +219,7 @@ function isUnsafeKey(key) {
|
|
|
213
219
|
* High-performance deep clone utility with descriptor support.
|
|
214
220
|
* Supports circular ref and complex built-in types.
|
|
215
221
|
*
|
|
216
|
-
* @version 1.0.
|
|
222
|
+
* @version 1.0.10
|
|
217
223
|
* @author Yusuke Kamiyamane
|
|
218
224
|
* @license MIT
|
|
219
225
|
* @copyright Copyright (c) 2026 Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -147,11 +147,17 @@ function cloneError(value, options, ref) {
|
|
|
147
147
|
result.name = name;
|
|
148
148
|
}
|
|
149
149
|
ref.set(value, result);
|
|
150
|
+
if (value.stack) {
|
|
151
|
+
try {
|
|
152
|
+
result.stack = value.stack;
|
|
153
|
+
} catch {
|
|
154
|
+
}
|
|
155
|
+
}
|
|
150
156
|
if ("cause" in value && value.cause !== void 0) {
|
|
151
157
|
result.cause = clone(value.cause, options, ref);
|
|
152
158
|
}
|
|
153
|
-
|
|
154
|
-
result
|
|
159
|
+
for (const key of Object.keys(value)) {
|
|
160
|
+
result[key] = clone(value[key], options, ref);
|
|
155
161
|
}
|
|
156
162
|
return result;
|
|
157
163
|
}
|
|
@@ -211,7 +217,7 @@ function isUnsafeKey(key) {
|
|
|
211
217
|
* High-performance deep clone utility with descriptor support.
|
|
212
218
|
* Supports circular ref and complex built-in types.
|
|
213
219
|
*
|
|
214
|
-
* @version 1.0.
|
|
220
|
+
* @version 1.0.10
|
|
215
221
|
* @author Yusuke Kamiyamane
|
|
216
222
|
* @license MIT
|
|
217
223
|
* @copyright Copyright (c) 2026 Yusuke Kamiyamane
|