bunshin-clone 1.2.3 → 1.2.4
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 +5 -5
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- 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.2.
|
|
16
|
+
import bunshinClone from 'https://esm.sh/bunshin-clone@1.2.4';
|
|
17
17
|
// or
|
|
18
|
-
import bunshinClone from 'https://cdn.jsdelivr.net/npm/bunshin-clone@1.2.
|
|
18
|
+
import bunshinClone from 'https://cdn.jsdelivr.net/npm/bunshin-clone@1.2.4/+esm';
|
|
19
19
|
// or
|
|
20
|
-
import bunshinClone from 'https://esm.unpkg.com/bunshin-clone@1.2.
|
|
20
|
+
import bunshinClone from 'https://esm.unpkg.com/bunshin-clone@1.2.4';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## 📦 APIs
|
|
@@ -34,8 +34,8 @@ bunshinClone(source, options);
|
|
|
34
34
|
|
|
35
35
|
```ts
|
|
36
36
|
interface BunshinCloneOptions {
|
|
37
|
-
preserveDescriptors
|
|
38
|
-
strictDescriptors
|
|
37
|
+
preserveDescriptors: boolean; // default: false
|
|
38
|
+
strictDescriptors: boolean; // default: false
|
|
39
39
|
}
|
|
40
40
|
```
|
|
41
41
|
|
package/dist/index.cjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
var EMPTY_OPTIONS = {};
|
|
5
5
|
var { hasOwnProperty: HAS_OWN } = Object.prototype;
|
|
6
|
-
function bunshinClone(source, options, refs) {
|
|
7
|
-
return clone(source, options
|
|
6
|
+
function bunshinClone(source, options = EMPTY_OPTIONS, refs = /* @__PURE__ */ new WeakMap()) {
|
|
7
|
+
return clone(source, options, refs);
|
|
8
8
|
}
|
|
9
9
|
function clone(node, options, refs) {
|
|
10
10
|
if (!isObject(node)) {
|
|
@@ -209,7 +209,7 @@ function isUnsafeKey(key) {
|
|
|
209
209
|
* High-performance deep clone utility with descriptor support.
|
|
210
210
|
* Handles circular ref and complex built-in types.
|
|
211
211
|
*
|
|
212
|
-
* @version 1.2.
|
|
212
|
+
* @version 1.2.4
|
|
213
213
|
* @author Yusuke Kamiyamane
|
|
214
214
|
* @license MIT
|
|
215
215
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
package/dist/index.d.cts
CHANGED
|
@@ -3,17 +3,17 @@
|
|
|
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.2.
|
|
6
|
+
* @version 1.2.4
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
10
10
|
* @see {@link https://github.com/y14e/bunshin-clone}
|
|
11
11
|
*/
|
|
12
12
|
interface BunshinCloneOptions {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
preserveDescriptors: boolean;
|
|
14
|
+
strictDescriptors: boolean;
|
|
15
15
|
}
|
|
16
16
|
type Refs = WeakMap<object, unknown>;
|
|
17
|
-
declare function bunshinClone<T>(source: T, options?: BunshinCloneOptions
|
|
17
|
+
declare function bunshinClone<T>(source: T, options?: Partial<BunshinCloneOptions>, refs?: Refs): T;
|
|
18
18
|
|
|
19
19
|
export { type BunshinCloneOptions, bunshinClone as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,17 +3,17 @@
|
|
|
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.2.
|
|
6
|
+
* @version 1.2.4
|
|
7
7
|
* @author Yusuke Kamiyamane
|
|
8
8
|
* @license MIT
|
|
9
9
|
* @copyright Copyright (c) Yusuke Kamiyamane
|
|
10
10
|
* @see {@link https://github.com/y14e/bunshin-clone}
|
|
11
11
|
*/
|
|
12
12
|
interface BunshinCloneOptions {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
preserveDescriptors: boolean;
|
|
14
|
+
strictDescriptors: boolean;
|
|
15
15
|
}
|
|
16
16
|
type Refs = WeakMap<object, unknown>;
|
|
17
|
-
declare function bunshinClone<T>(source: T, options?: BunshinCloneOptions
|
|
17
|
+
declare function bunshinClone<T>(source: T, options?: Partial<BunshinCloneOptions>, refs?: Refs): T;
|
|
18
18
|
|
|
19
19
|
export { type BunshinCloneOptions, bunshinClone as default };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
var EMPTY_OPTIONS = {};
|
|
3
3
|
var { hasOwnProperty: HAS_OWN } = Object.prototype;
|
|
4
|
-
function bunshinClone(source, options, refs) {
|
|
5
|
-
return clone(source, options
|
|
4
|
+
function bunshinClone(source, options = EMPTY_OPTIONS, refs = /* @__PURE__ */ new WeakMap()) {
|
|
5
|
+
return clone(source, options, refs);
|
|
6
6
|
}
|
|
7
7
|
function clone(node, options, refs) {
|
|
8
8
|
if (!isObject(node)) {
|
|
@@ -207,7 +207,7 @@ function isUnsafeKey(key) {
|
|
|
207
207
|
* High-performance deep clone utility with descriptor support.
|
|
208
208
|
* Handles circular ref and complex built-in types.
|
|
209
209
|
*
|
|
210
|
-
* @version 1.2.
|
|
210
|
+
* @version 1.2.4
|
|
211
211
|
* @author Yusuke Kamiyamane
|
|
212
212
|
* @license MIT
|
|
213
213
|
* @copyright Copyright (c) Yusuke Kamiyamane
|