@alwatr/deep-clone 1.0.1 → 1.0.3
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 +12 -0
- package/dist/main.cjs +3 -0
- package/dist/main.cjs.map +7 -0
- package/dist/main.d.ts +25 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.mjs +3 -0
- package/dist/main.mjs.map +7 -0
- package/package.json +4 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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.3](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.2...@alwatr/deep-clone@1.0.3) (2023-12-22)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* package.json include files ([97b35d1](https://github.com/Alwatr/nanolib/commit/97b35d11bf4125f482f595db81f284804d2870ed)) by @
|
|
11
|
+
|
|
12
|
+
## [1.0.2](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.1...@alwatr/deep-clone@1.0.2) (2023-12-22)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* package.json include files ([129a9a5](https://github.com/Alwatr/nanolib/commit/129a9a5df31f1199769432d7e689d213f2dcaa43)) by @
|
|
17
|
+
|
|
6
18
|
## [1.0.1](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.0...@alwatr/deep-clone@1.0.1) (2023-12-22)
|
|
7
19
|
|
|
8
20
|
### Bug Fixes
|
package/dist/main.cjs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/* @alwatr/deep-clone v1.0.3 */
|
|
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
|
+
//# sourceMappingURL=main.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
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 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,KACjB,KAAK,MAAM,KAAK,UAAUA,CAAG,CAAC,CACvC",
|
|
6
|
+
"names": ["main_exports", "__export", "deepClone", "__toCommonJS", "obj"]
|
|
7
|
+
}
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
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 declare function deepClone<T>(obj: T): T;
|
|
12
|
+
/**
|
|
13
|
+
* Clone deeply nested objects and arrays.
|
|
14
|
+
*
|
|
15
|
+
* if the object is null or undefined, it returns null.
|
|
16
|
+
*
|
|
17
|
+
* @param obj The object to clone.
|
|
18
|
+
* @returns A clone of the object.
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const obj2 = deepClone(obj1);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function deepClone<T>(obj: T | null | undefined): T | null;
|
|
25
|
+
//# sourceMappingURL=main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;AAExC;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC"}
|
package/dist/main.mjs
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
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 return JSON.parse(JSON.stringify(obj));\n}\n"],
|
|
5
|
+
"mappings": ";AA0BO,SAASA,EAAaC,EAAqC,CAChE,OAAIA,GAAO,KAAa,KACjB,KAAK,MAAM,KAAK,UAAUA,CAAG,CAAC,CACvC",
|
|
6
|
+
"names": ["deepClone", "obj"]
|
|
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.3",
|
|
4
4
|
"description": "Clone deeply nested objects and arrays in JavaScript.",
|
|
5
5
|
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
|
|
6
6
|
"keywords": [
|
|
@@ -25,10 +25,8 @@
|
|
|
25
25
|
},
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"files": [
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"CHANGELOG.md",
|
|
31
|
-
"dist/**/*"
|
|
28
|
+
"**/*.{js,mjs,cjs,map,d.ts,html,md}",
|
|
29
|
+
"!demo/**/*"
|
|
32
30
|
],
|
|
33
31
|
"publishConfig": {
|
|
34
32
|
"access": "public"
|
|
@@ -63,5 +61,5 @@
|
|
|
63
61
|
"@alwatr/tsconfig-base": "^1.0.2",
|
|
64
62
|
"typescript": "^5.3.3"
|
|
65
63
|
},
|
|
66
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "6f00efd555fe552b86ad87ccc7ba2126ec51d5fa"
|
|
67
65
|
}
|