bunshin-clone 1.2.15 → 1.3.1
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/README.md +3 -3
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,11 +13,11 @@ npm i bunshin-clone
|
|
|
13
13
|
import { bunshinClone } from 'bunshin-clone';
|
|
14
14
|
|
|
15
15
|
// CDNs
|
|
16
|
-
import { bunshinClone } from 'https://esm.sh/bunshin-clone@1.
|
|
16
|
+
import { bunshinClone } from 'https://esm.sh/bunshin-clone@1.3.1';
|
|
17
17
|
// or
|
|
18
|
-
import { bunshinClone } from 'https://cdn.jsdelivr.net/npm/bunshin-clone@1.
|
|
18
|
+
import { bunshinClone } from 'https://cdn.jsdelivr.net/npm/bunshin-clone@1.3.1/+esm';
|
|
19
19
|
// or
|
|
20
|
-
import { bunshinClone } from 'https://esm.unpkg.com/bunshin-clone@1.
|
|
20
|
+
import { bunshinClone } from 'https://esm.unpkg.com/bunshin-clone@1.3.1';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## 📦 APIs
|
package/dist/index.cjs
CHANGED
|
@@ -114,7 +114,7 @@ function clone(node, options, refs) {
|
|
|
114
114
|
return node;
|
|
115
115
|
}
|
|
116
116
|
function cloneError(value, settings, refs) {
|
|
117
|
-
const { name,
|
|
117
|
+
const { message, name, stack, cause } = value;
|
|
118
118
|
if (value instanceof DOMException) {
|
|
119
119
|
const result2 = new DOMException(message, name);
|
|
120
120
|
refs.set(value, result2);
|
|
@@ -219,7 +219,7 @@ function resolveOptions(options) {
|
|
|
219
219
|
* High-performance deep clone utility with descriptor support.
|
|
220
220
|
* Handles circular ref and complex built-in types.
|
|
221
221
|
*
|
|
222
|
-
* @version 1.
|
|
222
|
+
* @version 1.3.1
|
|
223
223
|
* @author Yusuke Kamiyamane
|
|
224
224
|
* @license MIT
|
|
225
225
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* High-performance deep clone utility with descriptor support.
|
|
4
4
|
* Handles circular ref and complex built-in types.
|
|
5
5
|
*
|
|
6
|
-
* @version 1.
|
|
6
|
+
* @version 1.3.1
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -13,12 +13,12 @@ interface BunshinCloneOptions {
|
|
|
13
13
|
preserveDescriptors: boolean;
|
|
14
14
|
strictDescriptors: boolean;
|
|
15
15
|
}
|
|
16
|
-
type
|
|
16
|
+
type PlainObject = Record<PropertyKey, unknown>;
|
|
17
17
|
type Refs = WeakMap<object, unknown>;
|
|
18
18
|
declare function bunshinClone<T>(source: T, options?: Partial<BunshinCloneOptions>, refs?: Refs): T;
|
|
19
|
-
declare function forEachOwnKey(object:
|
|
20
|
-
declare function isObject(value: unknown): value is
|
|
21
|
-
declare function isPlainObject(value: unknown):
|
|
19
|
+
declare function forEachOwnKey(object: PlainObject, callback: (key: string | symbol) => void): void;
|
|
20
|
+
declare function isObject(value: unknown): value is object;
|
|
21
|
+
declare function isPlainObject(value: unknown): value is PlainObject;
|
|
22
22
|
declare function isUnsafeKey(key: PropertyKey): boolean;
|
|
23
23
|
|
|
24
24
|
export { type BunshinCloneOptions, bunshinClone, forEachOwnKey, isObject, isPlainObject, isUnsafeKey };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* High-performance deep clone utility with descriptor support.
|
|
4
4
|
* Handles circular ref and complex built-in types.
|
|
5
5
|
*
|
|
6
|
-
* @version 1.
|
|
6
|
+
* @version 1.3.1
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
@@ -13,12 +13,12 @@ interface BunshinCloneOptions {
|
|
|
13
13
|
preserveDescriptors: boolean;
|
|
14
14
|
strictDescriptors: boolean;
|
|
15
15
|
}
|
|
16
|
-
type
|
|
16
|
+
type PlainObject = Record<PropertyKey, unknown>;
|
|
17
17
|
type Refs = WeakMap<object, unknown>;
|
|
18
18
|
declare function bunshinClone<T>(source: T, options?: Partial<BunshinCloneOptions>, refs?: Refs): T;
|
|
19
|
-
declare function forEachOwnKey(object:
|
|
20
|
-
declare function isObject(value: unknown): value is
|
|
21
|
-
declare function isPlainObject(value: unknown):
|
|
19
|
+
declare function forEachOwnKey(object: PlainObject, callback: (key: string | symbol) => void): void;
|
|
20
|
+
declare function isObject(value: unknown): value is object;
|
|
21
|
+
declare function isPlainObject(value: unknown): value is PlainObject;
|
|
22
22
|
declare function isUnsafeKey(key: PropertyKey): boolean;
|
|
23
23
|
|
|
24
24
|
export { type BunshinCloneOptions, bunshinClone, forEachOwnKey, isObject, isPlainObject, isUnsafeKey };
|
package/dist/index.js
CHANGED
|
@@ -112,7 +112,7 @@ function clone(node, options, refs) {
|
|
|
112
112
|
return node;
|
|
113
113
|
}
|
|
114
114
|
function cloneError(value, settings, refs) {
|
|
115
|
-
const { name,
|
|
115
|
+
const { message, name, stack, cause } = value;
|
|
116
116
|
if (value instanceof DOMException) {
|
|
117
117
|
const result2 = new DOMException(message, name);
|
|
118
118
|
refs.set(value, result2);
|
|
@@ -217,7 +217,7 @@ function resolveOptions(options) {
|
|
|
217
217
|
* High-performance deep clone utility with descriptor support.
|
|
218
218
|
* Handles circular ref and complex built-in types.
|
|
219
219
|
*
|
|
220
|
-
* @version 1.
|
|
220
|
+
* @version 1.3.1
|
|
221
221
|
* @author Yusuke Kamiyamane
|
|
222
222
|
* @license MIT
|
|
223
223
|
* @copyright Copyright (c) Yusuke Kamiyamane
|