@visulima/deep-clone 4.0.0-alpha.11 → 4.0.0-alpha.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/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## @visulima/deep-clone [4.0.0-alpha.12](https://github.com/visulima/visulima/compare/@visulima/deep-clone@4.0.0-alpha.11...@visulima/deep-clone@4.0.0-alpha.12) (2026-05-07)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **data-manipulation:** repair broken bench imports ([79ddd8f](https://github.com/visulima/visulima/commit/79ddd8f6892cd34ae12018f98afb826bcaaffb3e))
6
+
7
+ ### Miscellaneous Chores
8
+
9
+ * **deep-clone:** housekeeping cleanup ([c7cfcdc](https://github.com/visulima/visulima/commit/c7cfcdc1b136007e5bd9e070def83e6bd1cdd3f4))
10
+ * **deep-clone:** upgrade packem to 2.0.0-alpha.76 ([44cf737](https://github.com/visulima/visulima/commit/44cf73796d2f9e82341a77e1050291f0e292a9e5))
11
+ * simplify pnpm-workspace packages list ([7cab221](https://github.com/visulima/visulima/commit/7cab221163632d9b7aa044a6f88c49083103a869))
12
+
13
+ ### Continuous Integration
14
+
15
+ * integrate codspeed for benchmark tracking ([e758f3d](https://github.com/visulima/visulima/commit/e758f3da491cc00d3f8bbf10d7ba3fdf8deb5325))
16
+
1
17
  ## @visulima/deep-clone [4.0.0-alpha.11](https://github.com/visulima/visulima/compare/@visulima/deep-clone@4.0.0-alpha.10...@visulima/deep-clone@4.0.0-alpha.11) (2026-04-22)
2
18
 
3
19
  ### Bug Fixes
package/dist/handler.d.ts CHANGED
@@ -1,10 +1,35 @@
1
- export { copyArrayLoose, copyArrayStrict } from "./handler/copy-array.d.ts";
2
- export { default as copyArrayBuffer } from "./handler/copy-array-buffer.d.ts";
3
- export { default as copyBlob } from "./handler/copy-blob.d.ts";
4
- export { default as copyDataView } from "./handler/copy-data-view.d.ts";
5
- export { default as copyDate } from "./handler/copy-date.d.ts";
6
- export { default as copyError } from "./handler/copy-error.d.ts";
7
- export { copyMapLoose, copyMapStrict } from "./handler/copy-map.d.ts";
8
- export { copyObjectLoose, copyObjectStrict } from "./handler/copy-object.d.ts";
9
- export { copyRegExpLoose, copyRegExpStrict } from "./handler/copy-regexp.d.ts";
10
- export { copySetLoose, copySetStrict } from "./handler/copy-set.d.ts";
1
+ import { S as State, T as TypedArray } from "./packem_shared/types.d-DzHTRSVD.js";
2
+ declare const copyArrayLoose: <Value extends unknown[]>(array: Value, state: State) => Value;
3
+ /**
4
+ * Deeply copy the indexed values in the array, as well as any custom properties.
5
+ */
6
+ declare const copyArrayStrict: <Value extends unknown[]>(array: Value, state: State) => Value;
7
+ declare const copyArrayBuffer: <Value extends ArrayBuffer | ArrayBufferView | Buffer | TypedArray>(arrayBuffer: Value) => Value;
8
+ declare const copyBlob: <Value extends Blob>(blob: Value) => Value;
9
+ declare const copyDataView: <Value extends DataView>(dataView: Value) => Value;
10
+ declare const copyDate: <Value extends Date>(date: Value) => Value;
11
+ type ExtendedError = Error & {
12
+ code?: any;
13
+ errno?: any;
14
+ syscall?: any;
15
+ };
16
+ declare const copyError: <Value extends EvalError | ExtendedError | RangeError | ReferenceError | SyntaxError | TypeError | URIError>(object: Value, state: State) => Value;
17
+ declare const copyMapLoose: <Value extends Map<unknown, unknown>>(map: Value, state: State) => Value;
18
+ /**
19
+ * Deeply copy the keys and values of the original, as well as any custom properties.
20
+ */
21
+ declare const copyMapStrict: <Value extends Map<unknown, unknown>>(map: Value, state: State) => Value;
22
+ declare const copyObjectLoose: <Value extends Record<PropertyKey, unknown>>(object: Value, state: State) => Value;
23
+ /**
24
+ * Deeply copy the properties (keys and symbols) and values of the original, as well
25
+ * as any hidden or non-enumerable properties.
26
+ */
27
+ declare const copyObjectStrict: <Value extends Record<PropertyKey, unknown>>(object: Value, state: State) => Value;
28
+ declare const copyRegExpLoose: <Value extends RegExp>(regExp: Value) => Value;
29
+ declare const copyRegExpStrict: <Value extends RegExp>(regExp: Value, state: State) => Value;
30
+ declare const copySetLoose: <Value extends Set<unknown>>(set: Value, state: State) => Value;
31
+ /**
32
+ * Deeply copy the values of the original, as well as any custom properties.
33
+ */
34
+ declare const copySetStrict: <Value extends Set<unknown>>(set: Value, state: State) => Value;
35
+ export { copyArrayBuffer, copyArrayLoose, copyArrayStrict, copyBlob, copyDataView, copyDate, copyError, copyMapLoose, copyMapStrict, copyObjectLoose, copyObjectStrict, copyRegExpLoose, copyRegExpStrict, copySetLoose, copySetStrict };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,12 @@
1
- import type { Options } from "./types.d.ts";
2
- type DeepReadwrite<T> = T extends object | [] ? {
3
- -readonly [P in keyof T]: DeepReadwrite<T[P]>;
4
- } : T;
1
+ import { O as Options } from "./packem_shared/types.d-DzHTRSVD.js";
2
+ export { type S as State } from "./packem_shared/types.d-DzHTRSVD.js";
3
+ type DeepReadwrite<T> = T extends object | [] ? { -readonly [P in keyof T]: DeepReadwrite<T[P]> } : T;
5
4
  /**
6
- * Function that creates a deep clone of an object or array.
7
- * @template T - The type of the original data.
8
- * @param originalData The original data to be cloned. It uses the generic parameter `T`.
9
- * @param options Optional. The cloning options. Type of this parameter is `Options`.
10
- * @returns The deep cloned data with its type as `DeepReadwrite&lt;T>`.
11
- */
12
- export declare const deepClone: <T>(originalData: T, options?: Options) => DeepReadwrite<T>;
13
- export type { Options, State } from "./types.d.ts";
5
+ * Function that creates a deep clone of an object or array.
6
+ * @template T - The type of the original data.
7
+ * @param originalData The original data to be cloned. It uses the generic parameter `T`.
8
+ * @param options Optional. The cloning options. Type of this parameter is `Options`.
9
+ * @returns The deep cloned data with its type as `DeepReadwrite&lt;T>`.
10
+ */
11
+ declare const deepClone: <T>(originalData: T, options?: Options) => DeepReadwrite<T>;
12
+ export { type Options, deepClone };
@@ -0,0 +1,30 @@
1
+ type InternalHandler<Value> = (value: Value, state: State) => Value;
2
+ interface State {
3
+ cache: WeakMap<any, unknown>;
4
+ clone: InternalHandler<unknown>;
5
+ }
6
+ type Options = {
7
+ handler?: {
8
+ Array: InternalHandler<unknown[]>;
9
+ ArrayBuffer: InternalHandler<ArrayBuffer>;
10
+ Blob: InternalHandler<Blob>;
11
+ DataView: InternalHandler<DataView>;
12
+ Date: InternalHandler<Date>;
13
+ Error: InternalHandler<Error>;
14
+ Float32Array: InternalHandler<Float32Array>;
15
+ Float64Array: InternalHandler<Float64Array>;
16
+ Int8Array: InternalHandler<Int8Array>;
17
+ Int16Array: InternalHandler<Int16Array>;
18
+ Int32Array: InternalHandler<Int32Array>;
19
+ Map: InternalHandler<Map<unknown, unknown>>;
20
+ Object: InternalHandler<Record<string, unknown>>;
21
+ Promise: InternalHandler<Promise<unknown>>;
22
+ RegExp: InternalHandler<RegExp>;
23
+ Set: InternalHandler<Set<unknown>>;
24
+ WeakMap: InternalHandler<WeakMap<any, unknown>>;
25
+ WeakSet: InternalHandler<WeakSet<any>>;
26
+ };
27
+ strict?: boolean;
28
+ };
29
+ type TypedArray = BigInt64Array | BigUint64Array | Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array;
30
+ export { Options as O, State as S, TypedArray as T };
package/dist/utils.d.ts CHANGED
@@ -1,2 +1,10 @@
1
- export { default as copyOwnProperties } from "./utils/copy-own-properties.d.ts";
2
- export { default as getCleanClone } from "./utils/get-clean-clone.d.ts";
1
+ import { S as State } from "./packem_shared/types.d-DzHTRSVD.js";
2
+ /**
3
+ * Strict copy all properties contained on the object.
4
+ */
5
+ declare const copyOwnProperties: <Value>(value: Value, clone: Value, state: State) => Value;
6
+ /**
7
+ * Get an empty version of the object with the same prototype it has.
8
+ */
9
+ declare const getCleanClone: (input: unknown) => any;
10
+ export { copyOwnProperties, getCleanClone };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/deep-clone",
3
- "version": "4.0.0-alpha.11",
3
+ "version": "4.0.0-alpha.12",
4
4
  "description": "Fastest deep clone implementation.",
5
5
  "keywords": [
6
6
  "anolilab",
@@ -38,6 +38,11 @@
38
38
  "visulima"
39
39
  ],
40
40
  "homepage": "https://visulima.com/packages/deep-clone/",
41
+ "license": "MIT",
42
+ "author": {
43
+ "name": "Daniel Bannert",
44
+ "email": "d.bannert@anolilab.de"
45
+ },
41
46
  "repository": {
42
47
  "type": "git",
43
48
  "url": "https://github.com/visulima/visulima.git",
@@ -53,13 +58,19 @@
53
58
  "url": "https://anolilab.com/support"
54
59
  }
55
60
  ],
56
- "license": "MIT",
57
- "author": {
58
- "name": "Daniel Bannert",
59
- "email": "d.bannert@anolilab.de"
60
- },
61
- "sideEffects": false,
61
+ "files": [
62
+ "dist/**",
63
+ "README.md",
64
+ "CHANGELOG.md",
65
+ "LICENSE.md"
66
+ ],
67
+ "os": [
68
+ "darwin",
69
+ "linux",
70
+ "win32"
71
+ ],
62
72
  "type": "module",
73
+ "sideEffects": false,
63
74
  "exports": {
64
75
  ".": {
65
76
  "types": "./dist/index.d.ts",
@@ -75,22 +86,11 @@
75
86
  },
76
87
  "./package.json": "./package.json"
77
88
  },
78
- "files": [
79
- "dist/**",
80
- "README.md",
81
- "CHANGELOG.md",
82
- "LICENSE.md"
83
- ],
84
- "engines": {
85
- "node": "^22.14.0 || >=24.10.0"
86
- },
87
- "os": [
88
- "darwin",
89
- "linux",
90
- "win32"
91
- ],
92
89
  "publishConfig": {
93
90
  "access": "public",
94
91
  "provenance": true
92
+ },
93
+ "engines": {
94
+ "node": "^22.14.0 || >=24.10.0"
95
95
  }
96
96
  }
@@ -1,3 +0,0 @@
1
- import type { TypedArray } from "../types.d.ts";
2
- declare const copyArrayBuffer: <Value extends ArrayBuffer | ArrayBufferView | Buffer | TypedArray>(arrayBuffer: Value) => Value;
3
- export default copyArrayBuffer;
@@ -1,6 +0,0 @@
1
- import type { State } from "../types.d.ts";
2
- export declare const copyArrayLoose: <Value extends unknown[]>(array: Value, state: State) => Value;
3
- /**
4
- * Deeply copy the indexed values in the array, as well as any custom properties.
5
- */
6
- export declare const copyArrayStrict: <Value extends unknown[]>(array: Value, state: State) => Value;
@@ -1,2 +0,0 @@
1
- declare const copyBlob: <Value extends Blob>(blob: Value) => Value;
2
- export default copyBlob;
@@ -1,2 +0,0 @@
1
- declare const copyDataView: <Value extends DataView>(dataView: Value) => Value;
2
- export default copyDataView;
@@ -1,2 +0,0 @@
1
- declare const copyDate: <Value extends Date>(date: Value) => Value;
2
- export default copyDate;
@@ -1,8 +0,0 @@
1
- import type { State } from "../types.d.ts";
2
- type ExtendedError = Error & {
3
- code?: any;
4
- errno?: any;
5
- syscall?: any;
6
- };
7
- declare const copyError: <Value extends EvalError | ExtendedError | RangeError | ReferenceError | SyntaxError | TypeError | URIError>(object: Value, state: State) => Value;
8
- export default copyError;
@@ -1,6 +0,0 @@
1
- import type { State } from "../types.d.ts";
2
- export declare const copyMapLoose: <Value extends Map<unknown, unknown>>(map: Value, state: State) => Value;
3
- /**
4
- * Deeply copy the keys and values of the original, as well as any custom properties.
5
- */
6
- export declare const copyMapStrict: <Value extends Map<unknown, unknown>>(map: Value, state: State) => Value;
@@ -1,7 +0,0 @@
1
- import type { State } from "../types.d.ts";
2
- export declare const copyObjectLoose: <Value extends Record<PropertyKey, unknown>>(object: Value, state: State) => Value;
3
- /**
4
- * Deeply copy the properties (keys and symbols) and values of the original, as well
5
- * as any hidden or non-enumerable properties.
6
- */
7
- export declare const copyObjectStrict: <Value extends Record<PropertyKey, unknown>>(object: Value, state: State) => Value;
@@ -1,3 +0,0 @@
1
- import type { State } from "../types.d.ts";
2
- export declare const copyRegExpLoose: <Value extends RegExp>(regExp: Value) => Value;
3
- export declare const copyRegExpStrict: <Value extends RegExp>(regExp: Value, state: State) => Value;
@@ -1,6 +0,0 @@
1
- import type { State } from "../types.d.ts";
2
- export declare const copySetLoose: <Value extends Set<unknown>>(set: Value, state: State) => Value;
3
- /**
4
- * Deeply copy the values of the original, as well as any custom properties.
5
- */
6
- export declare const copySetStrict: <Value extends Set<unknown>>(set: Value, state: State) => Value;
package/dist/types.d.ts DELETED
@@ -1,30 +0,0 @@
1
- type InternalHandler<Value> = (value: Value, state: State) => Value;
2
- export interface State {
3
- cache: WeakMap<any, unknown>;
4
- clone: InternalHandler<unknown>;
5
- }
6
- export type Options = {
7
- handler?: {
8
- Array: InternalHandler<unknown[]>;
9
- ArrayBuffer: InternalHandler<ArrayBuffer>;
10
- Blob: InternalHandler<Blob>;
11
- DataView: InternalHandler<DataView>;
12
- Date: InternalHandler<Date>;
13
- Error: InternalHandler<Error>;
14
- Float32Array: InternalHandler<Float32Array>;
15
- Float64Array: InternalHandler<Float64Array>;
16
- Int8Array: InternalHandler<Int8Array>;
17
- Int16Array: InternalHandler<Int16Array>;
18
- Int32Array: InternalHandler<Int32Array>;
19
- Map: InternalHandler<Map<unknown, unknown>>;
20
- Object: InternalHandler<Record<string, unknown>>;
21
- Promise: InternalHandler<Promise<unknown>>;
22
- RegExp: InternalHandler<RegExp>;
23
- Set: InternalHandler<Set<unknown>>;
24
- WeakMap: InternalHandler<WeakMap<any, unknown>>;
25
- WeakSet: InternalHandler<WeakSet<any>>;
26
- };
27
- strict?: boolean;
28
- };
29
- export type TypedArray = BigInt64Array | BigUint64Array | Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array;
30
- export {};
@@ -1,6 +0,0 @@
1
- import type { State } from "../types.d.ts";
2
- /**
3
- * Strict copy all properties contained on the object.
4
- */
5
- declare const copyOwnProperties: <Value>(value: Value, clone: Value, state: State) => Value;
6
- export default copyOwnProperties;
@@ -1,5 +0,0 @@
1
- /**
2
- * Get an empty version of the object with the same prototype it has.
3
- */
4
- declare const getCleanClone: (input: unknown) => any;
5
- export default getCleanClone;