bunshin-clone 2.0.5 → 2.0.6
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.bundle.cjs +26 -24
- package/dist/index.bundle.js +26 -24
- package/dist/index.cjs +26 -24
- package/dist/index.js +26 -24
- package/package.json +4 -4
package/dist/index.bundle.cjs
CHANGED
|
@@ -255,6 +255,32 @@ function cloneURLSearchParams(params, refs) {
|
|
|
255
255
|
return result;
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
+
// src/options.ts
|
|
259
|
+
function resolveOptions(options) {
|
|
260
|
+
let {
|
|
261
|
+
preserveBufferSharing = false,
|
|
262
|
+
preserveDescriptors = false,
|
|
263
|
+
preserveSymbolKeys = false
|
|
264
|
+
} = options;
|
|
265
|
+
if (typeof preserveBufferSharing !== "boolean") {
|
|
266
|
+
console.warn("Invalid preserveBufferSharing option. Fallback: false.");
|
|
267
|
+
preserveBufferSharing = false;
|
|
268
|
+
}
|
|
269
|
+
if (typeof preserveDescriptors !== "boolean") {
|
|
270
|
+
console.warn("Invalid preserveDescriptors option. Fallback: false.");
|
|
271
|
+
preserveDescriptors = false;
|
|
272
|
+
}
|
|
273
|
+
if (typeof preserveSymbolKeys !== "boolean") {
|
|
274
|
+
console.warn("Invalid preserveSymbolKeys option. Fallback: false.");
|
|
275
|
+
preserveSymbolKeys = false;
|
|
276
|
+
}
|
|
277
|
+
return {
|
|
278
|
+
preserveBufferSharing,
|
|
279
|
+
preserveDescriptors,
|
|
280
|
+
preserveSymbolKeys
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
|
|
258
284
|
// src/index.ts
|
|
259
285
|
function bunshinClone(value, options = {}) {
|
|
260
286
|
return clone(value, resolveOptions(options), /* @__PURE__ */ new WeakMap());
|
|
@@ -312,30 +338,6 @@ function clone(value, settings, refs) {
|
|
|
312
338
|
refs.set(value, value);
|
|
313
339
|
return value;
|
|
314
340
|
}
|
|
315
|
-
function resolveOptions(options) {
|
|
316
|
-
let {
|
|
317
|
-
preserveBufferSharing = false,
|
|
318
|
-
preserveDescriptors = false,
|
|
319
|
-
preserveSymbolKeys = false
|
|
320
|
-
} = options;
|
|
321
|
-
if (typeof preserveBufferSharing !== "boolean") {
|
|
322
|
-
console.warn("Invalid preserveBufferSharing option. Fallback: false.");
|
|
323
|
-
preserveBufferSharing = false;
|
|
324
|
-
}
|
|
325
|
-
if (typeof preserveDescriptors !== "boolean") {
|
|
326
|
-
console.warn("Invalid preserveDescriptors option. Fallback: false.");
|
|
327
|
-
preserveDescriptors = false;
|
|
328
|
-
}
|
|
329
|
-
if (typeof preserveSymbolKeys !== "boolean") {
|
|
330
|
-
console.warn("Invalid preserveSymbolKeys option. Fallback: false.");
|
|
331
|
-
preserveSymbolKeys = false;
|
|
332
|
-
}
|
|
333
|
-
return {
|
|
334
|
-
preserveBufferSharing,
|
|
335
|
-
preserveDescriptors,
|
|
336
|
-
preserveSymbolKeys
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
341
|
|
|
340
342
|
exports.bunshinClone = bunshinClone;
|
|
341
343
|
exports.clone = clone;
|
package/dist/index.bundle.js
CHANGED
|
@@ -253,6 +253,32 @@ function cloneURLSearchParams(params, refs) {
|
|
|
253
253
|
return result;
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
+
// src/options.ts
|
|
257
|
+
function resolveOptions(options) {
|
|
258
|
+
let {
|
|
259
|
+
preserveBufferSharing = false,
|
|
260
|
+
preserveDescriptors = false,
|
|
261
|
+
preserveSymbolKeys = false
|
|
262
|
+
} = options;
|
|
263
|
+
if (typeof preserveBufferSharing !== "boolean") {
|
|
264
|
+
console.warn("Invalid preserveBufferSharing option. Fallback: false.");
|
|
265
|
+
preserveBufferSharing = false;
|
|
266
|
+
}
|
|
267
|
+
if (typeof preserveDescriptors !== "boolean") {
|
|
268
|
+
console.warn("Invalid preserveDescriptors option. Fallback: false.");
|
|
269
|
+
preserveDescriptors = false;
|
|
270
|
+
}
|
|
271
|
+
if (typeof preserveSymbolKeys !== "boolean") {
|
|
272
|
+
console.warn("Invalid preserveSymbolKeys option. Fallback: false.");
|
|
273
|
+
preserveSymbolKeys = false;
|
|
274
|
+
}
|
|
275
|
+
return {
|
|
276
|
+
preserveBufferSharing,
|
|
277
|
+
preserveDescriptors,
|
|
278
|
+
preserveSymbolKeys
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
|
|
256
282
|
// src/index.ts
|
|
257
283
|
function bunshinClone(value, options = {}) {
|
|
258
284
|
return clone(value, resolveOptions(options), /* @__PURE__ */ new WeakMap());
|
|
@@ -310,29 +336,5 @@ function clone(value, settings, refs) {
|
|
|
310
336
|
refs.set(value, value);
|
|
311
337
|
return value;
|
|
312
338
|
}
|
|
313
|
-
function resolveOptions(options) {
|
|
314
|
-
let {
|
|
315
|
-
preserveBufferSharing = false,
|
|
316
|
-
preserveDescriptors = false,
|
|
317
|
-
preserveSymbolKeys = false
|
|
318
|
-
} = options;
|
|
319
|
-
if (typeof preserveBufferSharing !== "boolean") {
|
|
320
|
-
console.warn("Invalid preserveBufferSharing option. Fallback: false.");
|
|
321
|
-
preserveBufferSharing = false;
|
|
322
|
-
}
|
|
323
|
-
if (typeof preserveDescriptors !== "boolean") {
|
|
324
|
-
console.warn("Invalid preserveDescriptors option. Fallback: false.");
|
|
325
|
-
preserveDescriptors = false;
|
|
326
|
-
}
|
|
327
|
-
if (typeof preserveSymbolKeys !== "boolean") {
|
|
328
|
-
console.warn("Invalid preserveSymbolKeys option. Fallback: false.");
|
|
329
|
-
preserveSymbolKeys = false;
|
|
330
|
-
}
|
|
331
|
-
return {
|
|
332
|
-
preserveBufferSharing,
|
|
333
|
-
preserveDescriptors,
|
|
334
|
-
preserveSymbolKeys
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
339
|
|
|
338
340
|
export { bunshinClone, clone, isObject, isPlainObject, isPrimitiveArray };
|
package/dist/index.cjs
CHANGED
|
@@ -217,6 +217,32 @@ function cloneURLSearchParams(params, refs) {
|
|
|
217
217
|
return result;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
+
// src/options.ts
|
|
221
|
+
function resolveOptions(options) {
|
|
222
|
+
let {
|
|
223
|
+
preserveBufferSharing = false,
|
|
224
|
+
preserveDescriptors = false,
|
|
225
|
+
preserveSymbolKeys = false
|
|
226
|
+
} = options;
|
|
227
|
+
if (typeof preserveBufferSharing !== "boolean") {
|
|
228
|
+
console.warn("Invalid preserveBufferSharing option. Fallback: false.");
|
|
229
|
+
preserveBufferSharing = false;
|
|
230
|
+
}
|
|
231
|
+
if (typeof preserveDescriptors !== "boolean") {
|
|
232
|
+
console.warn("Invalid preserveDescriptors option. Fallback: false.");
|
|
233
|
+
preserveDescriptors = false;
|
|
234
|
+
}
|
|
235
|
+
if (typeof preserveSymbolKeys !== "boolean") {
|
|
236
|
+
console.warn("Invalid preserveSymbolKeys option. Fallback: false.");
|
|
237
|
+
preserveSymbolKeys = false;
|
|
238
|
+
}
|
|
239
|
+
return {
|
|
240
|
+
preserveBufferSharing,
|
|
241
|
+
preserveDescriptors,
|
|
242
|
+
preserveSymbolKeys
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
|
|
220
246
|
// src/index.ts
|
|
221
247
|
function bunshinClone(value, options = {}) {
|
|
222
248
|
return clone(value, resolveOptions(options), /* @__PURE__ */ new WeakMap());
|
|
@@ -274,30 +300,6 @@ function clone(value, settings, refs) {
|
|
|
274
300
|
refs.set(value, value);
|
|
275
301
|
return value;
|
|
276
302
|
}
|
|
277
|
-
function resolveOptions(options) {
|
|
278
|
-
let {
|
|
279
|
-
preserveBufferSharing = false,
|
|
280
|
-
preserveDescriptors = false,
|
|
281
|
-
preserveSymbolKeys = false
|
|
282
|
-
} = options;
|
|
283
|
-
if (typeof preserveBufferSharing !== "boolean") {
|
|
284
|
-
console.warn("Invalid preserveBufferSharing option. Fallback: false.");
|
|
285
|
-
preserveBufferSharing = false;
|
|
286
|
-
}
|
|
287
|
-
if (typeof preserveDescriptors !== "boolean") {
|
|
288
|
-
console.warn("Invalid preserveDescriptors option. Fallback: false.");
|
|
289
|
-
preserveDescriptors = false;
|
|
290
|
-
}
|
|
291
|
-
if (typeof preserveSymbolKeys !== "boolean") {
|
|
292
|
-
console.warn("Invalid preserveSymbolKeys option. Fallback: false.");
|
|
293
|
-
preserveSymbolKeys = false;
|
|
294
|
-
}
|
|
295
|
-
return {
|
|
296
|
-
preserveBufferSharing,
|
|
297
|
-
preserveDescriptors,
|
|
298
|
-
preserveSymbolKeys
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
303
|
|
|
302
304
|
exports.bunshinClone = bunshinClone;
|
|
303
305
|
exports.clone = clone;
|
package/dist/index.js
CHANGED
|
@@ -215,6 +215,32 @@ function cloneURLSearchParams(params, refs) {
|
|
|
215
215
|
return result;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
+
// src/options.ts
|
|
219
|
+
function resolveOptions(options) {
|
|
220
|
+
let {
|
|
221
|
+
preserveBufferSharing = false,
|
|
222
|
+
preserveDescriptors = false,
|
|
223
|
+
preserveSymbolKeys = false
|
|
224
|
+
} = options;
|
|
225
|
+
if (typeof preserveBufferSharing !== "boolean") {
|
|
226
|
+
console.warn("Invalid preserveBufferSharing option. Fallback: false.");
|
|
227
|
+
preserveBufferSharing = false;
|
|
228
|
+
}
|
|
229
|
+
if (typeof preserveDescriptors !== "boolean") {
|
|
230
|
+
console.warn("Invalid preserveDescriptors option. Fallback: false.");
|
|
231
|
+
preserveDescriptors = false;
|
|
232
|
+
}
|
|
233
|
+
if (typeof preserveSymbolKeys !== "boolean") {
|
|
234
|
+
console.warn("Invalid preserveSymbolKeys option. Fallback: false.");
|
|
235
|
+
preserveSymbolKeys = false;
|
|
236
|
+
}
|
|
237
|
+
return {
|
|
238
|
+
preserveBufferSharing,
|
|
239
|
+
preserveDescriptors,
|
|
240
|
+
preserveSymbolKeys
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
218
244
|
// src/index.ts
|
|
219
245
|
function bunshinClone(value, options = {}) {
|
|
220
246
|
return clone(value, resolveOptions(options), /* @__PURE__ */ new WeakMap());
|
|
@@ -272,29 +298,5 @@ function clone(value, settings, refs) {
|
|
|
272
298
|
refs.set(value, value);
|
|
273
299
|
return value;
|
|
274
300
|
}
|
|
275
|
-
function resolveOptions(options) {
|
|
276
|
-
let {
|
|
277
|
-
preserveBufferSharing = false,
|
|
278
|
-
preserveDescriptors = false,
|
|
279
|
-
preserveSymbolKeys = false
|
|
280
|
-
} = options;
|
|
281
|
-
if (typeof preserveBufferSharing !== "boolean") {
|
|
282
|
-
console.warn("Invalid preserveBufferSharing option. Fallback: false.");
|
|
283
|
-
preserveBufferSharing = false;
|
|
284
|
-
}
|
|
285
|
-
if (typeof preserveDescriptors !== "boolean") {
|
|
286
|
-
console.warn("Invalid preserveDescriptors option. Fallback: false.");
|
|
287
|
-
preserveDescriptors = false;
|
|
288
|
-
}
|
|
289
|
-
if (typeof preserveSymbolKeys !== "boolean") {
|
|
290
|
-
console.warn("Invalid preserveSymbolKeys option. Fallback: false.");
|
|
291
|
-
preserveSymbolKeys = false;
|
|
292
|
-
}
|
|
293
|
-
return {
|
|
294
|
-
preserveBufferSharing,
|
|
295
|
-
preserveDescriptors,
|
|
296
|
-
preserveSymbolKeys
|
|
297
|
-
};
|
|
298
|
-
}
|
|
299
301
|
|
|
300
302
|
export { bunshinClone, clone, isObject, isPlainObject, isPrimitiveArray };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bunshin-clone",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "High-performance deep clone utility with descriptor support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -68,6 +68,9 @@
|
|
|
68
68
|
"prepublishOnly": "npm run build",
|
|
69
69
|
"test": "bun test"
|
|
70
70
|
},
|
|
71
|
+
"dependencies": {
|
|
72
|
+
"@y14e/own": "^1.0.3"
|
|
73
|
+
},
|
|
71
74
|
"devDependencies": {
|
|
72
75
|
"bun-types": "latest",
|
|
73
76
|
"tsup": "^8.0.0",
|
|
@@ -79,8 +82,5 @@
|
|
|
79
82
|
},
|
|
80
83
|
"allowScripts": {
|
|
81
84
|
"esbuild": true
|
|
82
|
-
},
|
|
83
|
-
"dependencies": {
|
|
84
|
-
"@y14e/own": "^1.0.3"
|
|
85
85
|
}
|
|
86
86
|
}
|