@alwatr/deep-clone 5.5.28 → 6.0.0

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/main.js ADDED
@@ -0,0 +1,5 @@
1
+ /* 📦 @alwatr/deep-clone v6.0.0 */
2
+ function f(a){if(a==null)return null;return JSON.parse(JSON.stringify(a))}export{f as deepClone};
3
+
4
+ //# debugId=2033D823D46C5A8F64756E2164756E21
5
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/main.ts"],
4
+ "sourcesContent": [
5
+ "/**\n * Clone deeply nested objects and arrays.\n *\n * @param obj The object to clone.\n * @returns A clone of the object.\n * @example\n * ```typescript\n * const obj2 = deepClone(obj1);\n * ```\n */\nexport function deepClone<T>(obj: T): T;\n\n/**\n * Clone deeply nested objects and arrays.\n *\n * if the object is null or undefined, it returns null.\n *\n * @param obj The object to clone.\n * @returns A clone of the object.\n * @example\n * ```typescript\n * const obj2 = deepClone(obj1);\n * ```\n */\nexport function deepClone<T>(obj: T | null | undefined): T | null;\n\nexport function deepClone<T>(obj: T | null | undefined): T | null {\n if (obj == null) return null;\n // I don`t know why structuredClone is slower than stringify! but I think its changes in the future.\n // if (typeof structuredClone === 'function') {\n // return structuredClone(obj);\n // }\n // else\n return JSON.parse(JSON.stringify(obj));\n}\n"
6
+ ],
7
+ "mappings": ";AA0BO,SAAS,CAAY,CAAC,EAAqC,CAChE,GAAI,GAAO,KAAM,OAAO,KAMxB,OAAO,KAAK,MAAM,KAAK,UAAU,CAAG,CAAC",
8
+ "debugId": "2033D823D46C5A8F64756E2164756E21",
9
+ "names": []
10
+ }
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
1
  {
2
2
  "name": "@alwatr/deep-clone",
3
3
  "description": "Clone deeply nested objects and arrays in JavaScript.",
4
- "version": "5.5.28",
4
+ "version": "6.0.0",
5
5
  "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
6
6
  "bugs": "https://github.com/Alwatr/nanolib/issues",
7
7
  "devDependencies": {
8
- "@alwatr/nano-build": "6.4.1",
9
- "@alwatr/prettier-config": "6.0.2",
10
- "@alwatr/tsconfig-base": "6.0.4",
8
+ "@alwatr/nano-build": "7.0.0",
9
+ "@alwatr/prettier-config": "7.0.0",
10
+ "@alwatr/tsconfig-base": "7.0.0",
11
11
  "typescript": "^5.9.3"
12
12
  },
13
13
  "exports": {
14
14
  ".": {
15
15
  "types": "./dist/main.d.ts",
16
- "import": "./dist/main.mjs",
17
- "require": "./dist/main.cjs"
16
+ "default": "./dist/main.js"
18
17
  }
19
18
  },
20
19
  "files": [
21
- "**/*.{js,mjs,cjs,map,d.ts,html,md,LEGAL.txt}",
20
+ "**/*.{js,mjs,cjs,ts,map,d.ts,html,LEGAL.txt}",
21
+ "README.md",
22
22
  "LICENSE",
23
23
  "!demo/**/*",
24
24
  "!**/*.test.js"
@@ -45,8 +45,6 @@
45
45
  "utils"
46
46
  ],
47
47
  "license": "MPL-2.0",
48
- "main": "./dist/main.cjs",
49
- "module": "./dist/main.mjs",
50
48
  "prettier": "@alwatr/prettier-config",
51
49
  "publishConfig": {
52
50
  "access": "public"
@@ -57,21 +55,21 @@
57
55
  "directory": "packages/deep-clone"
58
56
  },
59
57
  "scripts": {
60
- "b": "yarn run build",
61
- "build": "yarn run build:ts && yarn run build:es",
62
- "build:es": "nano-build --preset=module",
58
+ "b": "bun run build",
59
+ "build": "bun run build:ts && bun run build:es",
60
+ "build:es": "nano-build --preset=module src/main.ts",
63
61
  "build:ts": "tsc --build",
64
- "c": "yarn run clean",
65
- "cb": "yarn run clean && yarn run build",
62
+ "c": "bun run clean",
63
+ "cb": "bun run clean && bun run build",
66
64
  "clean": "rm -rfv dist *.tsbuildinfo",
67
- "d": "yarn run build:es && yarn node --enable-source-maps --trace-warnings",
68
- "w": "yarn run watch",
69
- "watch": "yarn run watch:ts & yarn run watch:es",
70
- "watch:es": "yarn run build:es --watch",
71
- "watch:ts": "yarn run build:ts --watch --preserveWatchOutput"
65
+ "d": "bun run build:es && bun",
66
+ "w": "bun run watch",
67
+ "watch": "bun run watch:ts & bun run watch:es",
68
+ "watch:es": "bun run build:es --watch",
69
+ "watch:ts": "bun run build:ts --watch --preserveWatchOutput"
72
70
  },
73
71
  "sideEffects": false,
74
72
  "type": "module",
75
73
  "types": "./dist/main.d.ts",
76
- "gitHead": "f9f9ba54b319ce8ccc6968059b222e89f4b5d149"
74
+ "gitHead": "056102a1c8a563bbae8a290b6830450f467322a3"
77
75
  }
package/src/main.ts ADDED
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Clone deeply nested objects and arrays.
3
+ *
4
+ * @param obj The object to clone.
5
+ * @returns A clone of the object.
6
+ * @example
7
+ * ```typescript
8
+ * const obj2 = deepClone(obj1);
9
+ * ```
10
+ */
11
+ export function deepClone<T>(obj: T): T;
12
+
13
+ /**
14
+ * Clone deeply nested objects and arrays.
15
+ *
16
+ * if the object is null or undefined, it returns null.
17
+ *
18
+ * @param obj The object to clone.
19
+ * @returns A clone of the object.
20
+ * @example
21
+ * ```typescript
22
+ * const obj2 = deepClone(obj1);
23
+ * ```
24
+ */
25
+ export function deepClone<T>(obj: T | null | undefined): T | null;
26
+
27
+ export function deepClone<T>(obj: T | null | undefined): T | null {
28
+ if (obj == null) return null;
29
+ // I don`t know why structuredClone is slower than stringify! but I think its changes in the future.
30
+ // if (typeof structuredClone === 'function') {
31
+ // return structuredClone(obj);
32
+ // }
33
+ // else
34
+ return JSON.parse(JSON.stringify(obj));
35
+ }
package/CHANGELOG.md DELETED
@@ -1,413 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [5.5.28](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.27...@alwatr/deep-clone@5.5.28) (2026-02-18)
7
-
8
- **Note:** Version bump only for package @alwatr/deep-clone
9
-
10
- ## [5.5.27](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.26...@alwatr/deep-clone@5.5.27) (2025-12-23)
11
-
12
- **Note:** Version bump only for package @alwatr/deep-clone
13
-
14
- ## [5.5.26](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.25...@alwatr/deep-clone@5.5.26) (2025-12-13)
15
-
16
- **Note:** Version bump only for package @alwatr/deep-clone
17
-
18
- ## [5.5.25](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.24...@alwatr/deep-clone@5.5.25) (2025-12-10)
19
-
20
- **Note:** Version bump only for package @alwatr/deep-clone
21
-
22
- ## [5.5.24](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.23...@alwatr/deep-clone@5.5.24) (2025-11-18)
23
-
24
- ### 🔨 Code Refactoring
25
-
26
- * remove unnecessary type declarations from tsconfig.json files ([89bcc7d](https://github.com/Alwatr/nanolib/commit/89bcc7db839807110b80f8ba34414ea9734d9c75))
27
-
28
- ## [5.5.23](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.22...@alwatr/deep-clone@5.5.23) (2025-11-15)
29
-
30
- **Note:** Version bump only for package @alwatr/deep-clone
31
-
32
- ## [5.5.22](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.21...@alwatr/deep-clone@5.5.22) (2025-11-15)
33
-
34
- **Note:** Version bump only for package @alwatr/deep-clone
35
-
36
- ## [5.5.21](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.20...@alwatr/deep-clone@5.5.21) (2025-11-04)
37
-
38
- **Note:** Version bump only for package @alwatr/deep-clone
39
-
40
- ## [5.5.20](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.19...@alwatr/deep-clone@5.5.20) (2025-10-06)
41
-
42
- ### 🔗 Dependencies update
43
-
44
- * bump the npm-dependencies group with 4 updates ([9825815](https://github.com/Alwatr/nanolib/commit/982581552bbb4b97dca52af5e93a80937f0c3109))
45
-
46
- ## [5.5.19](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.18...@alwatr/deep-clone@5.5.19) (2025-09-27)
47
-
48
- ### 🧹 Miscellaneous Chores
49
-
50
- * exclude test files from package distribution ([86f4f2f](https://github.com/Alwatr/nanolib/commit/86f4f2f5985845c5cf3a3a9398de7b2f98ce53e7))
51
-
52
- ## [5.5.18](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.17...@alwatr/deep-clone@5.5.18) (2025-09-22)
53
-
54
- **Note:** Version bump only for package @alwatr/deep-clone
55
-
56
- ## [5.5.17](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.16...@alwatr/deep-clone@5.5.17) (2025-09-22)
57
-
58
- **Note:** Version bump only for package @alwatr/deep-clone
59
-
60
- ## [5.5.16](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.15...@alwatr/deep-clone@5.5.16) (2025-09-21)
61
-
62
- **Note:** Version bump only for package @alwatr/deep-clone
63
-
64
- ## [5.5.15](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.14...@alwatr/deep-clone@5.5.15) (2025-09-20)
65
-
66
- ### 🐛 Bug Fixes
67
-
68
- * add sideEffects property to package.json files for better tree-shaking ([c7b9e74](https://github.com/Alwatr/nanolib/commit/c7b9e74e1920c8e35b438742de61883ca62da58c))
69
- * add sideEffects property to package.json files for better tree-shaking ([e8402c4](https://github.com/Alwatr/nanolib/commit/e8402c481a14a1f807a37aaa862a936713d26176))
70
-
71
- ### 🧹 Miscellaneous Chores
72
-
73
- * remove duplicate sideEffects property from multiple package.json files ([b123f86](https://github.com/Alwatr/nanolib/commit/b123f86be81481de2314aae9bb2eeb629743d24c))
74
-
75
- ## [5.5.14](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.13...@alwatr/deep-clone@5.5.14) (2025-09-19)
76
-
77
- **Note:** Version bump only for package @alwatr/deep-clone
78
-
79
- ## [5.5.13](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.12...@alwatr/deep-clone@5.5.13) (2025-09-15)
80
-
81
- **Note:** Version bump only for package @alwatr/deep-clone
82
-
83
- ## [5.5.12](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.11...@alwatr/deep-clone@5.5.12) (2025-09-13)
84
-
85
- **Note:** Version bump only for package @alwatr/deep-clone
86
-
87
- ## [5.5.11](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.10...@alwatr/deep-clone@5.5.11) (2025-09-13)
88
-
89
- ### 🧹 Miscellaneous Chores
90
-
91
- * remove package-tracer dependency and related code from fetch package ([96fe4e9](https://github.com/Alwatr/nanolib/commit/96fe4e9552a205f218ceed187c55e4e904a07089))
92
-
93
- ## [5.5.10](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.9...@alwatr/deep-clone@5.5.10) (2025-09-09)
94
-
95
- ### 🧹 Miscellaneous Chores
96
-
97
- * remove trailing newlines from contributing sections in README files ([e8ab1bc](https://github.com/Alwatr/nanolib/commit/e8ab1bc43e0addea5ccd4c897c2cec597cb9e15f))
98
-
99
- ## [5.5.9](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.8...@alwatr/deep-clone@5.5.9) (2025-09-06)
100
-
101
- **Note:** Version bump only for package @alwatr/deep-clone
102
-
103
- ## [5.5.8](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.7...@alwatr/deep-clone@5.5.8) (2025-09-05)
104
-
105
- **Note:** Version bump only for package @alwatr/deep-clone
106
-
107
- ## [5.5.7](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.6...@alwatr/deep-clone@5.5.7) (2025-09-01)
108
-
109
- **Note:** Version bump only for package @alwatr/deep-clone
110
-
111
- ## [5.5.6](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.5...@alwatr/deep-clone@5.5.6) (2025-08-23)
112
-
113
- **Note:** Version bump only for package @alwatr/deep-clone
114
-
115
- ## [5.5.5](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.3...@alwatr/deep-clone@5.5.5) (2025-08-23)
116
-
117
- ### 🐛 Bug Fixes
118
-
119
- * update license from AGPL-3.0-only to MPL-2.0 ([d20968e](https://github.com/Alwatr/nanolib/commit/d20968e60cc89b1dcdf9b96507178da6ed562f55))
120
- * update package versions in multiple package.json files ([7638b1c](https://github.com/Alwatr/nanolib/commit/7638b1cafee2b4e0f97db7a89ac9fba6384b9b10))
121
-
122
- ### 🔨 Code Refactoring
123
-
124
- * Updated all package.json files in the project to change dependency version specifiers from "workspace:^" to "workspace:*" for consistency and to allow for more flexible version resolution. ([db6a4f7](https://github.com/Alwatr/nanolib/commit/db6a4f76deec2d1d8039978144e4bc51b6f1a0e3))
125
-
126
- ### 🧹 Miscellaneous Chores
127
-
128
- * reformat all package.json files ([ceda45d](https://github.com/Alwatr/nanolib/commit/ceda45de186667790474f729cb4b161a5148ce19))
129
-
130
- ### 🔗 Dependencies update
131
-
132
- * update TypeScript and Jest versions across all packages to improve compatibility and performance ([31baf36](https://github.com/Alwatr/nanolib/commit/31baf366101e92e27db66a21c849fb101f19be47))
133
-
134
- ## [5.5.4](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.3...@alwatr/deep-clone@5.5.4) (2025-08-23)
135
-
136
- ### Code Refactoring
137
-
138
- * Updated all package.json files in the project to change dependency version specifiers from "workspace:^" to "workspace:*" for consistency and to allow for more flexible version resolution. ([db6a4f7](https://github.com/Alwatr/nanolib/commit/db6a4f76deec2d1d8039978144e4bc51b6f1a0e3)) by @alimd
139
-
140
- ## <small>5.5.3 (2025-04-15)</small>
141
-
142
- **Note:** Version bump only for package @alwatr/deep-clone
143
-
144
- ## [5.5.2](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.1...@alwatr/deep-clone@5.5.2) (2025-04-01)
145
-
146
- **Note:** Version bump only for package @alwatr/deep-clone
147
-
148
- ## [5.5.1](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.5.0...@alwatr/deep-clone@5.5.1) (2025-03-18)
149
-
150
- **Note:** Version bump only for package @alwatr/deep-clone
151
-
152
- ## [5.5.0](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@5.4.0...@alwatr/deep-clone@5.5.0) (2025-03-06)
153
-
154
- ### Miscellaneous Chores
155
-
156
- * update username casing in changelog entries ([9722ac9](https://github.com/Alwatr/nanolib/commit/9722ac9a078438a4e8ebfa5826ea70e0e3a52ca6)) by @
157
-
158
- ### Dependencies update
159
-
160
- * bump the development-dependencies group across 1 directory with 11 updates ([720c395](https://github.com/Alwatr/nanolib/commit/720c3954da55c929fe8fb16957121f4c51fb7f0c)) by @dependabot[bot]
161
-
162
- ## [5.4.0](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.1.8...@alwatr/deep-clone@5.4.0) (2025-02-18)
163
-
164
- ## 5.3.0 (2025-02-03)
165
-
166
- ### Miscellaneous Chores
167
-
168
- * edit README ([3860b3d](https://github.com/Alwatr/nanolib/commit/3860b3df48ab82dc479d5236c2e8579df614aabf)) by @
169
-
170
- ### Dependencies update
171
-
172
- * bump the development-dependencies group across 1 directory with 11 updates ([cb79d07](https://github.com/Alwatr/nanolib/commit/cb79d072a57c79e1c01abff1a293d6757bb65350)) by @
173
- * update typescript and @types/node to version 5.7.3 and 22.13.0 respectively across multiple packages ([ddab05b](https://github.com/Alwatr/nanolib/commit/ddab05b5d767c30191f36a065e4bc88744e8e3fe)) by @
174
-
175
- ## 5.0.0 (2024-11-02)
176
-
177
- ### ⚠ BREAKING CHANGES
178
-
179
- * To simplify version management and ensure consistency, all nanolib packages now use the same version as @alwatr/nanolib. This may require updates to your project's dependencies.
180
-
181
- ### Code Refactoring
182
-
183
- * use the same version as @alwatr/nanolib ([60eb860](https://github.com/Alwatr/nanolib/commit/60eb860a0e33dfffe2d1d95e63ce54c60876be06)) by @
184
-
185
- ## [5.3.0](https://github.com/Alwatr/nanolib/compare/v5.2.1...v5.3.0) (2025-02-03)
186
-
187
- ### Miscellaneous Chores
188
-
189
- * edit README ([3860b3d](https://github.com/Alwatr/nanolib/commit/3860b3df48ab82dc479d5236c2e8579df614aabf)) by @ArmanAsadian
190
-
191
- ### Dependencies update
192
-
193
- * bump the development-dependencies group across 1 directory with 11 updates ([cb79d07](https://github.com/Alwatr/nanolib/commit/cb79d072a57c79e1c01abff1a293d6757bb65350)) by @dependabot[bot]
194
- * update typescript and @types/node to version 5.7.3 and 22.13.0 respectively across multiple packages ([ddab05b](https://github.com/Alwatr/nanolib/commit/ddab05b5d767c30191f36a065e4bc88744e8e3fe)) by @alimd
195
-
196
- ## 5.0.0 (2024-11-02)
197
-
198
- ### ⚠ BREAKING CHANGES
199
-
200
- * To simplify version management and ensure consistency, all nanolib packages now use the same version as @alwatr/nanolib. This may require updates to your project's dependencies.
201
-
202
- ### Features
203
-
204
- * **deep-clone:** new package for deep clone obj/array ([9ac5379](https://github.com/Alwatr/nanolib/commit/9ac5379bd579b85d165a79b75bb782654167430d)) by @
205
- * use `package-tracer` ([cc3c5f9](https://github.com/Alwatr/nanolib/commit/cc3c5f9c1a3d03f0d81b46835665f16a0426fd0d)) by @
206
-
207
- ### Bug Fixes
208
-
209
- * all dependeny topology ([1c17f34](https://github.com/Alwatr/nanolib/commit/1c17f349adf3e98e2a80ab2da4f0f81028dc9c5f)) by @
210
- * **deep-clone:** deps ([2bce58c](https://github.com/Alwatr/nanolib/commit/2bce58c0742e3547a4bbc6c9efb792d5dca9375b)) by @
211
- * package.json include files ([97b35d1](https://github.com/Alwatr/nanolib/commit/97b35d11bf4125f482f595db81f284804d2870ed)) by @
212
- * package.json include files ([129a9a5](https://github.com/Alwatr/nanolib/commit/129a9a5df31f1199769432d7e689d213f2dcaa43)) by @
213
- * package.json include files ([053fc10](https://github.com/Alwatr/nanolib/commit/053fc10b518038647136db9ada2433e27ecb2e63)) by @
214
- * tsBuildInfoFile path in tsconfig.json files ([9c4ba01](https://github.com/Alwatr/nanolib/commit/9c4ba01afdd6657de4e5feef09bb6ee03d9ce053)) by @
215
- * update to latest nano-build with preset ([a4d3c35](https://github.com/Alwatr/nanolib/commit/a4d3c35f9d86521312bd16dd9853519f4ed2e0b4)) by @
216
-
217
- ### Code Refactoring
218
-
219
- * prevent side-effects ([01e00e1](https://github.com/Alwatr/nanolib/commit/01e00e191385cc92b28677df0c01a085916ae677)) by @
220
- * use the same version as @alwatr/nanolib ([60eb860](https://github.com/Alwatr/nanolib/commit/60eb860a0e33dfffe2d1d95e63ce54c60876be06)) by @
221
-
222
- ### Miscellaneous Chores
223
-
224
- * **deep-clone:** change the license to AGPL-3.0 ([062b9c5](https://github.com/Alwatr/nanolib/commit/062b9c5f0e6fc78fa39101d538f3ba8720ab073a)) by @
225
- * include LICENSE and LEGAL files to publish ([09f366f](https://github.com/Alwatr/nanolib/commit/09f366f680bfa9fb26acb2cd1ccbc68c5a9e9ad8)) by @
226
- * rename logger env ([38443ad](https://github.com/Alwatr/nanolib/commit/38443ade4677e857b5ebd4be417f5f2eb1818c87)) by @
227
- * Update build and lint scripts ([392d0b7](https://github.com/Alwatr/nanolib/commit/392d0b71f446bce336b0256119a80f07aff794ba)) by @
228
- * update clean script to remove all .tsbuildinfo files ([91f1ff2](https://github.com/Alwatr/nanolib/commit/91f1ff20c964d5327879c267f530a131526544d8)) by @
229
- * Update debug command in package.json ([be8403d](https://github.com/Alwatr/nanolib/commit/be8403dec754f2117259bb915b110ea386596401)) by @
230
- * update package keywords ([200afcf](https://github.com/Alwatr/nanolib/commit/200afcf53ae1db0e86a775c24ee1d83da771b1c0)) by @
231
- * Update package.json exports for [@alwatr](https://github.com/alwatr) packages ([dacb362](https://github.com/Alwatr/nanolib/commit/dacb362b145e3c51b4aba00ff643687a3fac11d2)) by @
232
-
233
- ### Dependencies update
234
-
235
- * bump the development-dependencies group across 1 directory with 10 updates ([9ed98ff](https://github.com/Alwatr/nanolib/commit/9ed98ffd0668d5a36e255c82edab3af53bffda8f)) by @
236
- * bump the development-dependencies group with 10 updates ([fa4aaf0](https://github.com/Alwatr/nanolib/commit/fa4aaf04c907ecae06aa14000ce35216170c15ad)) by @
237
- * upd ([451d025](https://github.com/Alwatr/nanolib/commit/451d0255ba96ed55f897a6f44f62cf4e6d2b12be)) by @
238
- * update all dependencies ([1e0c30e](https://github.com/Alwatr/nanolib/commit/1e0c30e6a3a8e19deb5185814e24ab6c08dca573)) by @
239
- * update all dependencies ([0e908b4](https://github.com/Alwatr/nanolib/commit/0e908b476a6b976ec2447f864c8cafcbb8a0f099)) by @
240
-
241
- ## [1.1.8](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.1.7...@alwatr/deep-clone@1.1.8) (2024-11-02)
242
-
243
- **Note:** Version bump only for package @alwatr/deep-clone
244
-
245
- ## [1.1.7](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.1.6...@alwatr/deep-clone@1.1.7) (2024-10-25)
246
-
247
- **Note:** Version bump only for package @alwatr/deep-clone
248
-
249
- ## [1.1.6](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.1.5...@alwatr/deep-clone@1.1.6) (2024-10-12)
250
-
251
- **Note:** Version bump only for package @alwatr/deep-clone
252
-
253
- ## [1.1.5](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.1.4...@alwatr/deep-clone@1.1.5) (2024-10-11)
254
-
255
- ### Code Refactoring
256
-
257
- - prevent side-effects ([01e00e1](https://github.com/Alwatr/nanolib/commit/01e00e191385cc92b28677df0c01a085916ae677)) by @mohammadhonarvar
258
-
259
- ## [1.1.4](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.1.3...@alwatr/deep-clone@1.1.4) (2024-10-11)
260
-
261
- ### Miscellaneous Chores
262
-
263
- - include LICENSE and LEGAL files to publish ([09f366f](https://github.com/Alwatr/nanolib/commit/09f366f680bfa9fb26acb2cd1ccbc68c5a9e9ad8)) by @alimd
264
-
265
- ## [1.1.3](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.1.2...@alwatr/deep-clone@1.1.3) (2024-10-11)
266
-
267
- **Note:** Version bump only for package @alwatr/deep-clone
268
-
269
- ## [1.1.2](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.1.1...@alwatr/deep-clone@1.1.2) (2024-10-10)
270
-
271
- ### Dependencies update
272
-
273
- - bump the development-dependencies group with 10 updates ([fa4aaf0](https://github.com/Alwatr/nanolib/commit/fa4aaf04c907ecae06aa14000ce35216170c15ad)) by @dependabot[bot]
274
-
275
- ## [1.1.1](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.1.0...@alwatr/deep-clone@1.1.1) (2024-10-08)
276
-
277
- **Note:** Version bump only for package @alwatr/deep-clone
278
-
279
- ## [1.1.0](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.24...@alwatr/deep-clone@1.1.0) (2024-09-29)
280
-
281
- ### Features
282
-
283
- - use `package-tracer` ([cc3c5f9](https://github.com/Alwatr/nanolib/commit/cc3c5f9c1a3d03f0d81b46835665f16a0426fd0d)) by @mohammadhonarvar
284
-
285
- ### Bug Fixes
286
-
287
- - all dependeny topology ([1c17f34](https://github.com/Alwatr/nanolib/commit/1c17f349adf3e98e2a80ab2da4f0f81028dc9c5f)) by @mohammadhonarvar
288
-
289
- ### Miscellaneous Chores
290
-
291
- - **deep-clone:** change the license to AGPL-3.0 ([062b9c5](https://github.com/Alwatr/nanolib/commit/062b9c5f0e6fc78fa39101d538f3ba8720ab073a)) by @ArmanAsadian
292
- - Update build and lint scripts ([392d0b7](https://github.com/Alwatr/nanolib/commit/392d0b71f446bce336b0256119a80f07aff794ba)) by @alimd
293
-
294
- ## [1.0.24](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.23...@alwatr/deep-clone@1.0.24) (2024-09-21)
295
-
296
- **Note:** Version bump only for package @alwatr/deep-clone
297
-
298
- ## [1.0.23](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.22...@alwatr/deep-clone@1.0.23) (2024-09-15)
299
-
300
- ### Dependencies update
301
-
302
- - bump the development-dependencies group across 1 directory with 10 updates ([9ed98ff](https://github.com/Alwatr/nanolib/commit/9ed98ffd0668d5a36e255c82edab3af53bffda8f)) by @dependabot[bot]
303
-
304
- ## [1.0.22](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.21...@alwatr/deep-clone@1.0.22) (2024-08-31)
305
-
306
- ### Miscellaneous Chores
307
-
308
- - Update package.json exports for [@alwatr](https://github.com/alwatr) packages ([dacb362](https://github.com/Alwatr/nanolib/commit/dacb362b145e3c51b4aba00ff643687a3fac11d2)) by @
309
-
310
- ## [1.0.21](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.20...@alwatr/deep-clone@1.0.21) (2024-08-31)
311
-
312
- ### Dependencies update
313
-
314
- - update all dependencies ([1e0c30e](https://github.com/Alwatr/nanolib/commit/1e0c30e6a3a8e19deb5185814e24ab6c08dca573)) by @alimd
315
-
316
- ## [1.0.20](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.19...@alwatr/deep-clone@1.0.20) (2024-07-04)
317
-
318
- ### Dependencies update
319
-
320
- - update all dependencies ([0e908b4](https://github.com/Alwatr/nanolib/commit/0e908b476a6b976ec2447f864c8cafcbb8a0f099)) by @
321
-
322
- ## [1.0.19](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.18...@alwatr/deep-clone@1.0.19) (2024-05-12)
323
-
324
- **Note:** Version bump only for package @alwatr/deep-clone
325
-
326
- ## [1.0.18](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.17...@alwatr/deep-clone@1.0.18) (2024-04-25)
327
-
328
- **Note:** Version bump only for package @alwatr/deep-clone
329
-
330
- ## [1.0.17](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.16...@alwatr/deep-clone@1.0.17) (2024-03-28)
331
-
332
- **Note:** Version bump only for package @alwatr/deep-clone
333
-
334
- ## [1.0.16](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.15...@alwatr/deep-clone@1.0.16) (2024-01-31)
335
-
336
- **Note:** Version bump only for package @alwatr/deep-clone
337
-
338
- ## [1.0.15](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.14...@alwatr/deep-clone@1.0.15) (2024-01-24)
339
-
340
- **Note:** Version bump only for package @alwatr/deep-clone
341
-
342
- ## [1.0.14](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.13...@alwatr/deep-clone@1.0.14) (2024-01-16)
343
-
344
- **Note:** Version bump only for package @alwatr/deep-clone
345
-
346
- ## [1.0.13](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.12...@alwatr/deep-clone@1.0.13) (2024-01-03)
347
-
348
- **Note:** Version bump only for package @alwatr/deep-clone
349
-
350
- ## [1.0.12](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.11...@alwatr/deep-clone@1.0.12) (2024-01-03)
351
-
352
- **Note:** Version bump only for package @alwatr/deep-clone
353
-
354
- ## [1.0.11](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.10...@alwatr/deep-clone@1.0.11) (2023-12-26)
355
-
356
- **Note:** Version bump only for package @alwatr/deep-clone
357
-
358
- ## [1.0.10](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.9...@alwatr/deep-clone@1.0.10) (2023-12-26)
359
-
360
- **Note:** Version bump only for package @alwatr/deep-clone
361
-
362
- ## [1.0.9](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.8...@alwatr/deep-clone@1.0.9) (2023-12-23)
363
-
364
- ### Bug Fixes
365
-
366
- - tsBuildInfoFile path in tsconfig.json files ([9c4ba01](https://github.com/Alwatr/nanolib/commit/9c4ba01afdd6657de4e5feef09bb6ee03d9ce053)) by @
367
-
368
- ## [1.0.8](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.7...@alwatr/deep-clone@1.0.8) (2023-12-23)
369
-
370
- **Note:** Version bump only for package @alwatr/deep-clone
371
-
372
- ## [1.0.7](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.6...@alwatr/deep-clone@1.0.7) (2023-12-23)
373
-
374
- **Note:** Version bump only for package @alwatr/deep-clone
375
-
376
- ## [1.0.6](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.5...@alwatr/deep-clone@1.0.6) (2023-12-23)
377
-
378
- ### Bug Fixes
379
-
380
- - update to latest nano-build with preset ([a4d3c35](https://github.com/Alwatr/nanolib/commit/a4d3c35f9d86521312bd16dd9853519f4ed2e0b4)) by @
381
-
382
- ## [1.0.5](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.4...@alwatr/deep-clone@1.0.5) (2023-12-22)
383
-
384
- **Note:** Version bump only for package @alwatr/deep-clone
385
-
386
- ## [1.0.4](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.3...@alwatr/deep-clone@1.0.4) (2023-12-22)
387
-
388
- **Note:** Version bump only for package @alwatr/deep-clone
389
-
390
- ## [1.0.3](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.2...@alwatr/deep-clone@1.0.3) (2023-12-22)
391
-
392
- ### Bug Fixes
393
-
394
- - package.json include files ([97b35d1](https://github.com/Alwatr/nanolib/commit/97b35d11bf4125f482f595db81f284804d2870ed)) by @
395
-
396
- ## [1.0.2](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.1...@alwatr/deep-clone@1.0.2) (2023-12-22)
397
-
398
- ### Bug Fixes
399
-
400
- - package.json include files ([129a9a5](https://github.com/Alwatr/nanolib/commit/129a9a5df31f1199769432d7e689d213f2dcaa43)) by @
401
-
402
- ## [1.0.1](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.0...@alwatr/deep-clone@1.0.1) (2023-12-22)
403
-
404
- ### Bug Fixes
405
-
406
- - **deep-clone:** deps ([2bce58c](https://github.com/Alwatr/nanolib/commit/2bce58c0742e3547a4bbc6c9efb792d5dca9375b)) by @alimd
407
- - package.json include files ([053fc10](https://github.com/Alwatr/nanolib/commit/053fc10b518038647136db9ada2433e27ecb2e63)) by @alimd
408
-
409
- # 1.0.0 (2023-12-22)
410
-
411
- ### Features
412
-
413
- - **deep-clone:** new package for deep clone obj/array ([9ac5379](https://github.com/Alwatr/nanolib/commit/9ac5379bd579b85d165a79b75bb782654167430d)) by @alimd
package/dist/main.cjs DELETED
@@ -1,4 +0,0 @@
1
- /** 📦 @alwatr/deep-clone v5.5.28 */
2
- __dev_mode__: console.debug("📦 @alwatr/deep-clone v5.5.28");
3
- "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:true}),mod);var main_exports={};__export(main_exports,{deepClone:()=>deepClone});module.exports=__toCommonJS(main_exports);function deepClone(obj){if(obj==null)return null;return JSON.parse(JSON.stringify(obj))}0&&(module.exports={deepClone});
4
- //# sourceMappingURL=main.cjs.map
package/dist/main.cjs.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/main.ts"],
4
- "sourcesContent": ["/**\n * Clone deeply nested objects and arrays.\n *\n * @param obj The object to clone.\n * @returns A clone of the object.\n * @example\n * ```typescript\n * const obj2 = deepClone(obj1);\n * ```\n */\nexport function deepClone<T>(obj: T): T;\n\n/**\n * Clone deeply nested objects and arrays.\n *\n * if the object is null or undefined, it returns null.\n *\n * @param obj The object to clone.\n * @returns A clone of the object.\n * @example\n * ```typescript\n * const obj2 = deepClone(obj1);\n * ```\n */\nexport function deepClone<T>(obj: T | null | undefined): T | null;\n\nexport function deepClone<T>(obj: T | null | undefined): T | null {\n if (obj == null) return null;\n // I don`t know why structuredClone is slower than stringify! but I think its changes in the future.\n // if (typeof structuredClone === 'function') {\n // return structuredClone(obj);\n // }\n // else\n return JSON.parse(JSON.stringify(obj));\n}\n"],
5
- "mappings": ";;qqBAAA,+GA0BO,SAAS,UAAa,IAAqC,CAChE,GAAI,KAAO,KAAM,OAAO,KAMxB,OAAO,KAAK,MAAM,KAAK,UAAU,GAAG,CAAC,CACvC",
6
- "names": []
7
- }
package/dist/main.mjs DELETED
@@ -1,4 +0,0 @@
1
- /** 📦 @alwatr/deep-clone v5.5.28 */
2
- __dev_mode__: console.debug("📦 @alwatr/deep-clone v5.5.28");
3
- function deepClone(obj){if(obj==null)return null;return JSON.parse(JSON.stringify(obj))}export{deepClone};
4
- //# sourceMappingURL=main.mjs.map
package/dist/main.mjs.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/main.ts"],
4
- "sourcesContent": ["/**\n * Clone deeply nested objects and arrays.\n *\n * @param obj The object to clone.\n * @returns A clone of the object.\n * @example\n * ```typescript\n * const obj2 = deepClone(obj1);\n * ```\n */\nexport function deepClone<T>(obj: T): T;\n\n/**\n * Clone deeply nested objects and arrays.\n *\n * if the object is null or undefined, it returns null.\n *\n * @param obj The object to clone.\n * @returns A clone of the object.\n * @example\n * ```typescript\n * const obj2 = deepClone(obj1);\n * ```\n */\nexport function deepClone<T>(obj: T | null | undefined): T | null;\n\nexport function deepClone<T>(obj: T | null | undefined): T | null {\n if (obj == null) return null;\n // I don`t know why structuredClone is slower than stringify! but I think its changes in the future.\n // if (typeof structuredClone === 'function') {\n // return structuredClone(obj);\n // }\n // else\n return JSON.parse(JSON.stringify(obj));\n}\n"],
5
- "mappings": ";;AA0BO,SAAS,UAAa,IAAqC,CAChE,GAAI,KAAO,KAAM,OAAO,KAMxB,OAAO,KAAK,MAAM,KAAK,UAAU,GAAG,CAAC,CACvC",
6
- "names": []
7
- }