bunshin-clone 2.0.8 → 2.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.bundle.cjs +4 -4
- package/dist/index.bundle.js +4 -4
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.bundle.cjs
CHANGED
|
@@ -128,12 +128,12 @@ function createErrorInstance(error, settings, refs) {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
// src/clone/image-data.ts
|
|
131
|
-
function cloneImageData(
|
|
132
|
-
const { data
|
|
133
|
-
const result = new ImageData(new Uint8ClampedArray(
|
|
131
|
+
function cloneImageData(image, refs) {
|
|
132
|
+
const { data, width, height, colorSpace } = image;
|
|
133
|
+
const result = new ImageData(new Uint8ClampedArray(data), width, height, {
|
|
134
134
|
colorSpace
|
|
135
135
|
});
|
|
136
|
-
refs.set(
|
|
136
|
+
refs.set(image, result);
|
|
137
137
|
return result;
|
|
138
138
|
}
|
|
139
139
|
|
package/dist/index.bundle.js
CHANGED
|
@@ -126,12 +126,12 @@ function createErrorInstance(error, settings, refs) {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
// src/clone/image-data.ts
|
|
129
|
-
function cloneImageData(
|
|
130
|
-
const { data
|
|
131
|
-
const result = new ImageData(new Uint8ClampedArray(
|
|
129
|
+
function cloneImageData(image, refs) {
|
|
130
|
+
const { data, width, height, colorSpace } = image;
|
|
131
|
+
const result = new ImageData(new Uint8ClampedArray(data), width, height, {
|
|
132
132
|
colorSpace
|
|
133
133
|
});
|
|
134
|
-
refs.set(
|
|
134
|
+
refs.set(image, result);
|
|
135
135
|
return result;
|
|
136
136
|
}
|
|
137
137
|
|
package/dist/index.cjs
CHANGED
|
@@ -130,12 +130,12 @@ function createErrorInstance(error, settings, refs) {
|
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
// src/clone/image-data.ts
|
|
133
|
-
function cloneImageData(
|
|
134
|
-
const { data
|
|
135
|
-
const result = new ImageData(new Uint8ClampedArray(
|
|
133
|
+
function cloneImageData(image, refs) {
|
|
134
|
+
const { data, width, height, colorSpace } = image;
|
|
135
|
+
const result = new ImageData(new Uint8ClampedArray(data), width, height, {
|
|
136
136
|
colorSpace
|
|
137
137
|
});
|
|
138
|
-
refs.set(
|
|
138
|
+
refs.set(image, result);
|
|
139
139
|
return result;
|
|
140
140
|
}
|
|
141
141
|
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type Refs = WeakMap<object, object>;
|
|
2
2
|
|
|
3
|
-
interface
|
|
3
|
+
interface BunshinCloneOptions {
|
|
4
4
|
preserveBufferSharing: boolean;
|
|
5
5
|
preserveDescriptors: boolean;
|
|
6
6
|
preserveSymbolKeys: boolean;
|
|
@@ -13,7 +13,7 @@ declare function isPrimitiveArray(array: Array_): boolean;
|
|
|
13
13
|
declare function isObject(value: unknown): value is object;
|
|
14
14
|
declare function isPlainObject(value: unknown): value is PlainObject;
|
|
15
15
|
|
|
16
|
-
declare function bunshinClone<T>(value: T, options?: Partial<
|
|
17
|
-
declare function clone<T>(value: T, settings:
|
|
16
|
+
declare function bunshinClone<T>(value: T, options?: Partial<BunshinCloneOptions>): T;
|
|
17
|
+
declare function clone<T>(value: T, settings: BunshinCloneOptions, refs: Refs): T;
|
|
18
18
|
|
|
19
|
-
export { type
|
|
19
|
+
export { type BunshinCloneOptions, type PlainObject, bunshinClone, clone, isObject, isPlainObject, isPrimitiveArray };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type Refs = WeakMap<object, object>;
|
|
2
2
|
|
|
3
|
-
interface
|
|
3
|
+
interface BunshinCloneOptions {
|
|
4
4
|
preserveBufferSharing: boolean;
|
|
5
5
|
preserveDescriptors: boolean;
|
|
6
6
|
preserveSymbolKeys: boolean;
|
|
@@ -13,7 +13,7 @@ declare function isPrimitiveArray(array: Array_): boolean;
|
|
|
13
13
|
declare function isObject(value: unknown): value is object;
|
|
14
14
|
declare function isPlainObject(value: unknown): value is PlainObject;
|
|
15
15
|
|
|
16
|
-
declare function bunshinClone<T>(value: T, options?: Partial<
|
|
17
|
-
declare function clone<T>(value: T, settings:
|
|
16
|
+
declare function bunshinClone<T>(value: T, options?: Partial<BunshinCloneOptions>): T;
|
|
17
|
+
declare function clone<T>(value: T, settings: BunshinCloneOptions, refs: Refs): T;
|
|
18
18
|
|
|
19
|
-
export { type
|
|
19
|
+
export { type BunshinCloneOptions, type PlainObject, bunshinClone, clone, isObject, isPlainObject, isPrimitiveArray };
|
package/dist/index.js
CHANGED
|
@@ -128,12 +128,12 @@ function createErrorInstance(error, settings, refs) {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
// src/clone/image-data.ts
|
|
131
|
-
function cloneImageData(
|
|
132
|
-
const { data
|
|
133
|
-
const result = new ImageData(new Uint8ClampedArray(
|
|
131
|
+
function cloneImageData(image, refs) {
|
|
132
|
+
const { data, width, height, colorSpace } = image;
|
|
133
|
+
const result = new ImageData(new Uint8ClampedArray(data), width, height, {
|
|
134
134
|
colorSpace
|
|
135
135
|
});
|
|
136
|
-
refs.set(
|
|
136
|
+
refs.set(image, result);
|
|
137
137
|
return result;
|
|
138
138
|
}
|
|
139
139
|
|