@alwatr/deep-clone 1.0.16 → 1.0.18
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 +8 -0
- package/dist/main.cjs +1 -1
- package/dist/main.cjs.map +2 -2
- package/dist/main.mjs +1 -1
- package/dist/main.mjs.map +2 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.0.18](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.17...@alwatr/deep-clone@1.0.18) (2024-04-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @alwatr/deep-clone
|
|
9
|
+
|
|
10
|
+
## [1.0.17](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.16...@alwatr/deep-clone@1.0.17) (2024-03-28)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @alwatr/deep-clone
|
|
13
|
+
|
|
6
14
|
## [1.0.16](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.15...@alwatr/deep-clone@1.0.16) (2024-01-31)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @alwatr/deep-clone
|
package/dist/main.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* @alwatr/deep-clone v1.0.
|
|
1
|
+
/* @alwatr/deep-clone v1.0.18 */
|
|
2
2
|
"use strict";var o=Object.defineProperty;var t=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var d=(n,e)=>{for(var u in e)o(n,u,{get:e[u],enumerable:!0})},f=(n,e,u,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of T(e))!i.call(n,l)&&l!==u&&o(n,l,{get:()=>e[l],enumerable:!(r=t(e,l))||r.enumerable});return n};var p=n=>f(o({},"__esModule",{value:!0}),n);var x={};d(x,{deepClone:()=>c});module.exports=p(x);function c(n){return n==null?null:JSON.parse(JSON.stringify(n))}0&&(module.exports={deepClone});
|
|
3
3
|
//# sourceMappingURL=main.cjs.map
|
package/dist/main.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 return JSON.parse(JSON.stringify(obj));\n}\n"],
|
|
5
|
-
"mappings": ";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,IAAA,eAAAC,EAAAH,GA0BO,SAASE,EAAaE,EAAqC,CAChE,OAAIA,GAAO,KAAa,
|
|
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": ";yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,IAAA,eAAAC,EAAAH,GA0BO,SAASE,EAAaE,EAAqC,CAChE,OAAIA,GAAO,KAAa,KAMjB,KAAK,MAAM,KAAK,UAAUA,CAAG,CAAC,CACvC",
|
|
6
6
|
"names": ["main_exports", "__export", "deepClone", "__toCommonJS", "obj"]
|
|
7
7
|
}
|
package/dist/main.mjs
CHANGED
package/dist/main.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 return JSON.parse(JSON.stringify(obj));\n}\n"],
|
|
5
|
-
"mappings": ";AA0BO,SAASA,EAAaC,EAAqC,CAChE,OAAIA,GAAO,KAAa,
|
|
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,SAASA,EAAaC,EAAqC,CAChE,OAAIA,GAAO,KAAa,KAMjB,KAAK,MAAM,KAAK,UAAUA,CAAG,CAAC,CACvC",
|
|
6
6
|
"names": ["deepClone", "obj"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwatr/deep-clone",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "Clone deeply nested objects and arrays in JavaScript.",
|
|
5
5
|
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
|
|
6
6
|
"keywords": [
|
|
@@ -67,10 +67,10 @@
|
|
|
67
67
|
"clean": "rm -rfv dist *.tsbuildinfo"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@alwatr/nano-build": "^1.3.
|
|
70
|
+
"@alwatr/nano-build": "^1.3.5",
|
|
71
71
|
"@alwatr/prettier-config": "^1.0.4",
|
|
72
72
|
"@alwatr/tsconfig-base": "^1.1.2",
|
|
73
|
-
"typescript": "^5.
|
|
73
|
+
"typescript": "^5.4.5"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "3feed4f16719c2371f372aa7f6c45c371c9d7758"
|
|
76
76
|
}
|