@alwatr/deep-clone 1.0.2 → 1.0.4

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 ADDED
@@ -0,0 +1,33 @@
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
+ ## [1.0.4](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.3...@alwatr/deep-clone@1.0.4) (2023-12-22)
7
+
8
+ **Note:** Version bump only for package @alwatr/deep-clone
9
+
10
+ ## [1.0.3](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.2...@alwatr/deep-clone@1.0.3) (2023-12-22)
11
+
12
+ ### Bug Fixes
13
+
14
+ * package.json include files ([97b35d1](https://github.com/Alwatr/nanolib/commit/97b35d11bf4125f482f595db81f284804d2870ed)) by @
15
+
16
+ ## [1.0.2](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.1...@alwatr/deep-clone@1.0.2) (2023-12-22)
17
+
18
+ ### Bug Fixes
19
+
20
+ * package.json include files ([129a9a5](https://github.com/Alwatr/nanolib/commit/129a9a5df31f1199769432d7e689d213f2dcaa43)) by @
21
+
22
+ ## [1.0.1](https://github.com/Alwatr/nanolib/compare/@alwatr/deep-clone@1.0.0...@alwatr/deep-clone@1.0.1) (2023-12-22)
23
+
24
+ ### Bug Fixes
25
+
26
+ * **deep-clone:** deps ([2bce58c](https://github.com/Alwatr/nanolib/commit/2bce58c0742e3547a4bbc6c9efb792d5dca9375b)) by @AliMD
27
+ * package.json include files ([053fc10](https://github.com/Alwatr/nanolib/commit/053fc10b518038647136db9ada2433e27ecb2e63)) by @AliMD
28
+
29
+ # 1.0.0 (2023-12-22)
30
+
31
+ ### Features
32
+
33
+ * **deep-clone:** new package for deep clone obj/array ([9ac5379](https://github.com/Alwatr/nanolib/commit/9ac5379bd579b85d165a79b75bb782654167430d)) by @AliMD
package/dist/main.cjs ADDED
@@ -0,0 +1,3 @@
1
+ /* @alwatr/deep-clone v1.0.4 */
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,3 @@
1
+ /* @alwatr/deep-clone v1.0.4 */
2
+ function e(n){return n==null?null:JSON.parse(JSON.stringify(n))}export{e as deepClone};
3
+ //# sourceMappingURL=main.mjs.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": ";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.2",
3
+ "version": "1.0.4",
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,7 +25,8 @@
25
25
  },
26
26
  "license": "MIT",
27
27
  "files": [
28
- "dist/**/*"
28
+ "**/*.{js,mjs,cjs,map,d.ts,html,md}",
29
+ "!demo/**/*"
29
30
  ],
30
31
  "publishConfig": {
31
32
  "access": "public"
@@ -55,10 +56,10 @@
55
56
  "clean": "rm -rfv dist .tsbuildinfo"
56
57
  },
57
58
  "devDependencies": {
58
- "@alwatr/nano-build": "^1.0.2",
59
- "@alwatr/prettier-config": "^1.0.2",
60
- "@alwatr/tsconfig-base": "^1.0.2",
59
+ "@alwatr/nano-build": "^1.0.3",
60
+ "@alwatr/prettier-config": "^1.0.3",
61
+ "@alwatr/tsconfig-base": "^1.0.3",
61
62
  "typescript": "^5.3.3"
62
63
  },
63
- "gitHead": "0a3ee8e3534dbaf155c85a2d128720c799fc32cd"
64
+ "gitHead": "1d09455da68f4f5ad0109d839a4fa5281fcb8213"
64
65
  }