bunshin-clone 1.2.10 → 1.2.12

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 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.10';
16
+ import { bunshinClone } from 'https://esm.sh/bunshin-clone@1.2.12';
17
17
  // or
18
- import { bunshinClone } from 'https://cdn.jsdelivr.net/npm/bunshin-clone@1.2.10/+esm';
18
+ import { bunshinClone } from 'https://cdn.jsdelivr.net/npm/bunshin-clone@1.2.12/+esm';
19
19
  // or
20
- import { bunshinClone } from 'https://esm.unpkg.com/bunshin-clone@1.2.10';
20
+ import { bunshinClone } from 'https://esm.unpkg.com/bunshin-clone@1.2.12';
21
21
  ```
22
22
 
23
23
  ## 📦 APIs
package/dist/index.cjs CHANGED
@@ -180,12 +180,12 @@ function cloneWithDescriptors(node, options, refs) {
180
180
  });
181
181
  return result;
182
182
  }
183
- function forEachOwnKey(object, fn) {
183
+ function forEachOwnKey(object, callback) {
184
184
  for (const key of Object.keys(object)) {
185
- fn(key);
185
+ callback(key);
186
186
  }
187
187
  for (const symbol of Object.getOwnPropertySymbols(object)) {
188
- fn(symbol);
188
+ callback(symbol);
189
189
  }
190
190
  }
191
191
  function isObject(value) {
@@ -206,7 +206,7 @@ function isUnsafeKey(key) {
206
206
  * High-performance deep clone utility with descriptor support.
207
207
  * Handles circular ref and complex built-in types.
208
208
  *
209
- * @version 1.2.10
209
+ * @version 1.2.12
210
210
  * @author Yusuke Kamiyamane
211
211
  * @license MIT
212
212
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -214,3 +214,7 @@ function isUnsafeKey(key) {
214
214
  */
215
215
 
216
216
  exports.bunshinClone = bunshinClone;
217
+ exports.forEachOwnKey = forEachOwnKey;
218
+ exports.isObject = isObject;
219
+ exports.isPlainObject = isPlainObject;
220
+ exports.isUnsafeKey = isUnsafeKey;
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.2.10
6
+ * @version 1.2.12
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -15,5 +15,9 @@ interface BunshinCloneOptions {
15
15
  }
16
16
  type Refs = WeakMap<object, unknown>;
17
17
  declare function bunshinClone<T>(source: T, options?: Partial<BunshinCloneOptions>, refs?: Refs): T;
18
+ declare function forEachOwnKey(object: object, callback: (key: string | symbol) => void): void;
19
+ declare function isObject(value: unknown): boolean;
20
+ declare function isPlainObject(value: unknown): boolean;
21
+ declare function isUnsafeKey(key: PropertyKey): boolean;
18
22
 
19
- export { type BunshinCloneOptions, bunshinClone };
23
+ 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.2.10
6
+ * @version 1.2.12
7
7
  * @author Yusuke Kamiyamane
8
8
  * @license MIT
9
9
  * @copyright Copyright (c) Yusuke Kamiyamane
@@ -15,5 +15,9 @@ interface BunshinCloneOptions {
15
15
  }
16
16
  type Refs = WeakMap<object, unknown>;
17
17
  declare function bunshinClone<T>(source: T, options?: Partial<BunshinCloneOptions>, refs?: Refs): T;
18
+ declare function forEachOwnKey(object: object, callback: (key: string | symbol) => void): void;
19
+ declare function isObject(value: unknown): boolean;
20
+ declare function isPlainObject(value: unknown): boolean;
21
+ declare function isUnsafeKey(key: PropertyKey): boolean;
18
22
 
19
- export { type BunshinCloneOptions, bunshinClone };
23
+ export { type BunshinCloneOptions, bunshinClone, forEachOwnKey, isObject, isPlainObject, isUnsafeKey };
package/dist/index.js CHANGED
@@ -178,12 +178,12 @@ function cloneWithDescriptors(node, options, refs) {
178
178
  });
179
179
  return result;
180
180
  }
181
- function forEachOwnKey(object, fn) {
181
+ function forEachOwnKey(object, callback) {
182
182
  for (const key of Object.keys(object)) {
183
- fn(key);
183
+ callback(key);
184
184
  }
185
185
  for (const symbol of Object.getOwnPropertySymbols(object)) {
186
- fn(symbol);
186
+ callback(symbol);
187
187
  }
188
188
  }
189
189
  function isObject(value) {
@@ -204,11 +204,11 @@ function isUnsafeKey(key) {
204
204
  * High-performance deep clone utility with descriptor support.
205
205
  * Handles circular ref and complex built-in types.
206
206
  *
207
- * @version 1.2.10
207
+ * @version 1.2.12
208
208
  * @author Yusuke Kamiyamane
209
209
  * @license MIT
210
210
  * @copyright Copyright (c) Yusuke Kamiyamane
211
211
  * @see {@link https://github.com/y14e/bunshin-clone}
212
212
  */
213
213
 
214
- export { bunshinClone };
214
+ export { bunshinClone, forEachOwnKey, isObject, isPlainObject, isUnsafeKey };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunshin-clone",
3
- "version": "1.2.10",
3
+ "version": "1.2.12",
4
4
  "description": "High-performance deep clone utility with descriptor support",
5
5
  "keywords": [
6
6
  "array",