bunshin-clone 1.8.16 → 1.9.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/dist/index.cjs CHANGED
@@ -352,5 +352,14 @@ function resolveOptions(options) {
352
352
  };
353
353
  }
354
354
 
355
+ exports.OWN_DESCS = OWN_DESCS;
356
+ exports.OWN_ENUM_STRING_KEYS = OWN_ENUM_STRING_KEYS;
357
+ exports.OWN_ENUM_SYMBOL_KEYS = OWN_ENUM_SYMBOL_KEYS;
358
+ exports.OWN_STRING_KEYS = OWN_STRING_KEYS;
359
+ exports.OWN_SYMBOL_KEYS = OWN_SYMBOL_KEYS;
355
360
  exports.bunshinClone = bunshinClone;
356
361
  exports.clone = clone;
362
+ exports.isObject = isObject;
363
+ exports.isPlainObject = isPlainObject;
364
+ exports.isPrimitiveArray = isPrimitiveArray;
365
+ exports.isUnsafeKey = isUnsafeKey;
package/dist/index.d.cts CHANGED
@@ -6,8 +6,26 @@ interface BunshinCloneOptions {
6
6
  preserveSymbolKeys: boolean;
7
7
  strictDescriptors: boolean;
8
8
  }
9
+ type PlainObject = Record<PropertyKey, unknown>;
10
+
11
+ declare function isPrimitiveArray(array: unknown[]): boolean;
12
+
13
+ declare const OWN_DESCS: <T>(o: T) => { [P in keyof T]: TypedPropertyDescriptor<T[P]>; } & {
14
+ [x: string]: PropertyDescriptor;
15
+ };
16
+ declare const OWN_ENUM_STRING_KEYS: {
17
+ (o: object): string[];
18
+ (o: {}): string[];
19
+ };
20
+ declare const OWN_ENUM_SYMBOL_KEYS: (o: PlainObject) => symbol[];
21
+ declare const OWN_STRING_KEYS: (o: any) => string[];
22
+ declare const OWN_SYMBOL_KEYS: (o: any) => symbol[];
23
+
24
+ declare function isObject(value: unknown): value is object;
25
+ declare function isPlainObject(value: unknown): value is PlainObject;
26
+ declare function isUnsafeKey(key: PropertyKey): boolean;
9
27
 
10
28
  declare function bunshinClone<T>(value: T, options?: Partial<BunshinCloneOptions>): T;
11
29
  declare function clone<T>(value: T, settings: BunshinCloneOptions, refs: Refs): T;
12
30
 
13
- export { bunshinClone, clone };
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
@@ -6,8 +6,26 @@ interface BunshinCloneOptions {
6
6
  preserveSymbolKeys: boolean;
7
7
  strictDescriptors: boolean;
8
8
  }
9
+ type PlainObject = Record<PropertyKey, unknown>;
10
+
11
+ declare function isPrimitiveArray(array: unknown[]): boolean;
12
+
13
+ declare const OWN_DESCS: <T>(o: T) => { [P in keyof T]: TypedPropertyDescriptor<T[P]>; } & {
14
+ [x: string]: PropertyDescriptor;
15
+ };
16
+ declare const OWN_ENUM_STRING_KEYS: {
17
+ (o: object): string[];
18
+ (o: {}): string[];
19
+ };
20
+ declare const OWN_ENUM_SYMBOL_KEYS: (o: PlainObject) => symbol[];
21
+ declare const OWN_STRING_KEYS: (o: any) => string[];
22
+ declare const OWN_SYMBOL_KEYS: (o: any) => symbol[];
23
+
24
+ declare function isObject(value: unknown): value is object;
25
+ declare function isPlainObject(value: unknown): value is PlainObject;
26
+ declare function isUnsafeKey(key: PropertyKey): boolean;
9
27
 
10
28
  declare function bunshinClone<T>(value: T, options?: Partial<BunshinCloneOptions>): T;
11
29
  declare function clone<T>(value: T, settings: BunshinCloneOptions, refs: Refs): T;
12
30
 
13
- export { bunshinClone, clone };
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
@@ -350,4 +350,4 @@ function resolveOptions(options) {
350
350
  };
351
351
  }
352
352
 
353
- export { bunshinClone, clone };
353
+ export { OWN_DESCS, OWN_ENUM_STRING_KEYS, OWN_ENUM_SYMBOL_KEYS, OWN_STRING_KEYS, OWN_SYMBOL_KEYS, bunshinClone, clone, isObject, isPlainObject, isPrimitiveArray, isUnsafeKey };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunshin-clone",
3
- "version": "1.8.16",
3
+ "version": "1.9.1",
4
4
  "description": "High-performance deep clone utility with descriptor support",
5
5
  "keywords": [
6
6
  "array",