@alwatr/deep-clone 6.0.0 → 6.0.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/main.js +2 -2
- package/dist/main.js.map +1 -1
- package/package.json +34 -35
package/dist/main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 📦 @alwatr/deep-clone v6.0.
|
|
1
|
+
/* 📦 @alwatr/deep-clone v6.0.1 */
|
|
2
2
|
function f(a){if(a==null)return null;return JSON.parse(JSON.stringify(a))}export{f as deepClone};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=87D25B997AF78DD964756E2164756E21
|
|
5
5
|
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
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
6
|
],
|
|
7
7
|
"mappings": ";AA0BO,SAAS,CAAY,CAAC,EAAqC,CAChE,GAAI,GAAO,KAAM,OAAO,KAMxB,OAAO,KAAK,MAAM,KAAK,UAAU,CAAG,CAAC",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "87D25B997AF78DD964756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
package/package.json
CHANGED
|
@@ -1,21 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwatr/deep-clone",
|
|
3
|
+
"version": "6.0.1",
|
|
3
4
|
"description": "Clone deeply nested objects and arrays in JavaScript.",
|
|
4
|
-
"
|
|
5
|
+
"license": "MPL-2.0",
|
|
5
6
|
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"typescript": "^5.9.3"
|
|
7
|
+
"type": "module",
|
|
8
|
+
"repository": {
|
|
9
|
+
"directory": "packages/deep-clone",
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/Alwatr/nanolib"
|
|
12
12
|
},
|
|
13
|
+
"homepage": "https://github.com/Alwatr/nanolib/tree/next/packages/deep-clone#readme",
|
|
14
|
+
"bugs": "https://github.com/Alwatr/nanolib/issues",
|
|
13
15
|
"exports": {
|
|
14
16
|
".": {
|
|
15
17
|
"types": "./dist/main.d.ts",
|
|
16
18
|
"default": "./dist/main.js"
|
|
17
19
|
}
|
|
18
20
|
},
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@alwatr/nano-build": "7.0.1",
|
|
24
|
+
"@alwatr/prettier-config": "7.0.1",
|
|
25
|
+
"@alwatr/tsconfig-base": "8.0.0",
|
|
26
|
+
"typescript": "^5.9.3"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"b": "bun run build",
|
|
30
|
+
"build": "bun run build:ts && bun run build:es",
|
|
31
|
+
"build:es": "nano-build --preset=module src/main.ts",
|
|
32
|
+
"build:ts": "tsc --build",
|
|
33
|
+
"c": "bun run clean",
|
|
34
|
+
"cb": "bun run clean && bun run build",
|
|
35
|
+
"clean": "rm -rfv dist *.tsbuildinfo",
|
|
36
|
+
"d": "bun run build:es && bun",
|
|
37
|
+
"w": "bun run watch",
|
|
38
|
+
"watch": "bun run watch:ts & bun run watch:es",
|
|
39
|
+
"watch:es": "bun run build:es --watch",
|
|
40
|
+
"watch:ts": "bun run build:ts --watch --preserveWatchOutput"
|
|
41
|
+
},
|
|
19
42
|
"files": [
|
|
20
43
|
"**/*.{js,mjs,cjs,ts,map,d.ts,html,LEGAL.txt}",
|
|
21
44
|
"README.md",
|
|
@@ -23,7 +46,9 @@
|
|
|
23
46
|
"!demo/**/*",
|
|
24
47
|
"!**/*.test.js"
|
|
25
48
|
],
|
|
26
|
-
"
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public"
|
|
51
|
+
},
|
|
27
52
|
"keywords": [
|
|
28
53
|
"alwatr",
|
|
29
54
|
"browser",
|
|
@@ -44,32 +69,6 @@
|
|
|
44
69
|
"utility",
|
|
45
70
|
"utils"
|
|
46
71
|
],
|
|
47
|
-
"license": "MPL-2.0",
|
|
48
72
|
"prettier": "@alwatr/prettier-config",
|
|
49
|
-
"
|
|
50
|
-
"access": "public"
|
|
51
|
-
},
|
|
52
|
-
"repository": {
|
|
53
|
-
"type": "git",
|
|
54
|
-
"url": "https://github.com/Alwatr/nanolib",
|
|
55
|
-
"directory": "packages/deep-clone"
|
|
56
|
-
},
|
|
57
|
-
"scripts": {
|
|
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",
|
|
61
|
-
"build:ts": "tsc --build",
|
|
62
|
-
"c": "bun run clean",
|
|
63
|
-
"cb": "bun run clean && bun run build",
|
|
64
|
-
"clean": "rm -rfv dist *.tsbuildinfo",
|
|
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"
|
|
70
|
-
},
|
|
71
|
-
"sideEffects": false,
|
|
72
|
-
"type": "module",
|
|
73
|
-
"types": "./dist/main.d.ts",
|
|
74
|
-
"gitHead": "056102a1c8a563bbae8a290b6830450f467322a3"
|
|
73
|
+
"gitHead": "f843742e94d6ebed3921d57b624d9deb35c2c102"
|
|
75
74
|
}
|