bunshin-clone 1.9.0 → 1.9.2
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 +10 -10
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -10
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -66,10 +66,10 @@ function cloneBuffer(buffer, refs) {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
// src/clone/blob.ts
|
|
69
|
-
function cloneBlob(
|
|
70
|
-
const { size, type } =
|
|
71
|
-
const result =
|
|
72
|
-
refs.set(
|
|
69
|
+
function cloneBlob(blob, refs) {
|
|
70
|
+
const { size, type } = blob;
|
|
71
|
+
const result = blob.slice(0, size, type);
|
|
72
|
+
refs.set(blob, result);
|
|
73
73
|
return result;
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -208,16 +208,16 @@ function isPrimitiveSet(set) {
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
// src/clone/url.ts
|
|
211
|
-
function cloneURL(
|
|
212
|
-
const result = new URL(
|
|
213
|
-
refs.set(
|
|
211
|
+
function cloneURL(url, refs) {
|
|
212
|
+
const result = new URL(url.href);
|
|
213
|
+
refs.set(url, result);
|
|
214
214
|
return result;
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
// src/clone/url-search-params.ts
|
|
218
|
-
function cloneURLSearchParams(
|
|
219
|
-
const result = new URLSearchParams(
|
|
220
|
-
refs.set(
|
|
218
|
+
function cloneURLSearchParams(params, refs) {
|
|
219
|
+
const result = new URLSearchParams(params);
|
|
220
|
+
refs.set(params, result);
|
|
221
221
|
return result;
|
|
222
222
|
}
|
|
223
223
|
|
package/dist/index.d.cts
CHANGED
|
@@ -28,4 +28,4 @@ declare function isUnsafeKey(key: PropertyKey): boolean;
|
|
|
28
28
|
declare function bunshinClone<T>(value: T, options?: Partial<BunshinCloneOptions>): T;
|
|
29
29
|
declare function clone<T>(value: T, settings: BunshinCloneOptions, refs: Refs): T;
|
|
30
30
|
|
|
31
|
-
export { OWN_DESCS, OWN_ENUM_STRING_KEYS, OWN_ENUM_SYMBOL_KEYS, OWN_STRING_KEYS, OWN_SYMBOL_KEYS, bunshinClone, clone, isObject, isPlainObject, isPrimitiveArray, isUnsafeKey };
|
|
31
|
+
export { type BunshinCloneOptions, OWN_DESCS, OWN_ENUM_STRING_KEYS, OWN_ENUM_SYMBOL_KEYS, OWN_STRING_KEYS, OWN_SYMBOL_KEYS, type PlainObject, bunshinClone, clone, isObject, isPlainObject, isPrimitiveArray, isUnsafeKey };
|
package/dist/index.d.ts
CHANGED
|
@@ -28,4 +28,4 @@ declare function isUnsafeKey(key: PropertyKey): boolean;
|
|
|
28
28
|
declare function bunshinClone<T>(value: T, options?: Partial<BunshinCloneOptions>): T;
|
|
29
29
|
declare function clone<T>(value: T, settings: BunshinCloneOptions, refs: Refs): T;
|
|
30
30
|
|
|
31
|
-
export { OWN_DESCS, OWN_ENUM_STRING_KEYS, OWN_ENUM_SYMBOL_KEYS, OWN_STRING_KEYS, OWN_SYMBOL_KEYS, bunshinClone, clone, isObject, isPlainObject, isPrimitiveArray, isUnsafeKey };
|
|
31
|
+
export { type BunshinCloneOptions, OWN_DESCS, OWN_ENUM_STRING_KEYS, OWN_ENUM_SYMBOL_KEYS, OWN_STRING_KEYS, OWN_SYMBOL_KEYS, type PlainObject, bunshinClone, clone, isObject, isPlainObject, isPrimitiveArray, isUnsafeKey };
|
package/dist/index.js
CHANGED
|
@@ -64,10 +64,10 @@ function cloneBuffer(buffer, refs) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
// src/clone/blob.ts
|
|
67
|
-
function cloneBlob(
|
|
68
|
-
const { size, type } =
|
|
69
|
-
const result =
|
|
70
|
-
refs.set(
|
|
67
|
+
function cloneBlob(blob, refs) {
|
|
68
|
+
const { size, type } = blob;
|
|
69
|
+
const result = blob.slice(0, size, type);
|
|
70
|
+
refs.set(blob, result);
|
|
71
71
|
return result;
|
|
72
72
|
}
|
|
73
73
|
|
|
@@ -206,16 +206,16 @@ function isPrimitiveSet(set) {
|
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
// src/clone/url.ts
|
|
209
|
-
function cloneURL(
|
|
210
|
-
const result = new URL(
|
|
211
|
-
refs.set(
|
|
209
|
+
function cloneURL(url, refs) {
|
|
210
|
+
const result = new URL(url.href);
|
|
211
|
+
refs.set(url, result);
|
|
212
212
|
return result;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
// src/clone/url-search-params.ts
|
|
216
|
-
function cloneURLSearchParams(
|
|
217
|
-
const result = new URLSearchParams(
|
|
218
|
-
refs.set(
|
|
216
|
+
function cloneURLSearchParams(params, refs) {
|
|
217
|
+
const result = new URLSearchParams(params);
|
|
218
|
+
refs.set(params, result);
|
|
219
219
|
return result;
|
|
220
220
|
}
|
|
221
221
|
|