@fangzhongya/utils 0.0.5 → 0.0.6

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.
@@ -1,8 +1,9 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-J53DPBUN.cjs');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-YBUHXX5U.cjs');
2
2
 
3
3
 
4
- var _chunkYZULJRHHcjs = require('../chunk-YZULJRHH.cjs');
5
- require('../chunk-VAYHA5HS.cjs');
4
+ var _chunkR7G5MSGOcjs = require('../chunk-R7G5MSGO.cjs');
5
+ require('../chunk-NRJPCN4J.cjs');
6
+ require('../chunk-3VYRYSWK.cjs');
6
7
 
7
8
 
8
9
  var _chunk4PBAZ73Icjs = require('../chunk-4PBAZ73I.cjs');
@@ -18,4 +19,4 @@ require('../chunk-5AZGAKWR.cjs');
18
19
 
19
20
 
20
21
 
21
- exports.array = _chunkJNC5JEFBcjs.array_exports; exports.object = _chunkYZULJRHHcjs.object_exports; exports.string = _chunk4PBAZ73Icjs.string_exports;
22
+ exports.array = _chunkJNC5JEFBcjs.array_exports; exports.object = _chunkR7G5MSGOcjs.object_exports; exports.string = _chunk4PBAZ73Icjs.string_exports;
@@ -1,8 +1,9 @@
1
1
  export { i as array } from '../index-6be6487f.js';
2
- export { i as object } from '../index-5c5bf158.js';
2
+ export { i as object } from '../index-8473d4b5.js';
3
3
  export { i as string } from '../index-5691335a.js';
4
4
  import './array/isArray.js';
5
5
  import './array/toggleArray.js';
6
- import './object/isObject.js';
7
6
  import './object/mergeObject.js';
7
+ import './object/isObject.js';
8
+ import './object/unmergeObject.js';
8
9
  import './string/index2.js';
@@ -1,8 +1,9 @@
1
- import "../chunk-P33DGEQL.js";
1
+ import "../chunk-75TBDXR6.js";
2
2
  import {
3
3
  object_exports
4
- } from "../chunk-AZNBYC7K.js";
5
- import "../chunk-LYFX6BGT.js";
4
+ } from "../chunk-MAIGGOA4.js";
5
+ import "../chunk-RD4EP3M5.js";
6
+ import "../chunk-A6J46LQK.js";
6
7
  import {
7
8
  string_exports
8
9
  } from "../chunk-YYNHNLVW.js";
@@ -1,9 +1,10 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-YZULJRHH.cjs');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-R7G5MSGO.cjs');
2
2
 
3
3
 
4
+ var _chunkNRJPCN4Jcjs = require('../../chunk-NRJPCN4J.cjs');
4
5
 
5
6
 
6
- var _chunkVAYHA5HScjs = require('../../chunk-VAYHA5HS.cjs');
7
+ var _chunk3VYRYSWKcjs = require('../../chunk-3VYRYSWK.cjs');
7
8
 
8
9
 
9
10
  var _chunkXRGLFTH2cjs = require('../../chunk-XRGLFTH2.cjs');
@@ -13,5 +14,4 @@ require('../../chunk-5AZGAKWR.cjs');
13
14
 
14
15
 
15
16
 
16
-
17
- exports.isObject = _chunkXRGLFTH2cjs.isObject; exports.mergeObject = _chunkVAYHA5HScjs.mergeObject; exports.mergeObject2 = _chunkVAYHA5HScjs.mergeObject2; exports.unmergeObject = _chunkVAYHA5HScjs.unmergeObject;
17
+ exports.isObject = _chunkXRGLFTH2cjs.isObject; exports.mergeObject = _chunkNRJPCN4Jcjs.mergeObject; exports.unmergeObject = _chunk3VYRYSWKcjs.unmergeObject;
@@ -1,2 +1,3 @@
1
+ export { mergeObject } from './mergeObject.js';
1
2
  export { isObject } from './isObject.js';
2
- export { mergeObject, mergeObject2, unmergeObject } from './mergeObject.js';
3
+ export { unmergeObject } from './unmergeObject.js';
@@ -1,9 +1,10 @@
1
- import "../../chunk-AZNBYC7K.js";
1
+ import "../../chunk-MAIGGOA4.js";
2
+ import {
3
+ mergeObject
4
+ } from "../../chunk-RD4EP3M5.js";
2
5
  import {
3
- mergeObject,
4
- mergeObject2,
5
6
  unmergeObject
6
- } from "../../chunk-LYFX6BGT.js";
7
+ } from "../../chunk-A6J46LQK.js";
7
8
  import {
8
9
  isObject
9
10
  } from "../../chunk-WO6JQRTD.js";
@@ -12,6 +13,5 @@ import "../../chunk-UICA3PK6.js";
12
13
  export {
13
14
  isObject,
14
15
  mergeObject,
15
- mergeObject2,
16
16
  unmergeObject
17
17
  };
@@ -1,11 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
-
4
-
5
- var _chunkVAYHA5HScjs = require('../../chunk-VAYHA5HS.cjs');
3
+ var _chunkNRJPCN4Jcjs = require('../../chunk-NRJPCN4J.cjs');
6
4
  require('../../chunk-5AZGAKWR.cjs');
7
5
 
8
6
 
9
-
10
-
11
- exports.mergeObject = _chunkVAYHA5HScjs.mergeObject; exports.mergeObject2 = _chunkVAYHA5HScjs.mergeObject2; exports.unmergeObject = _chunkVAYHA5HScjs.unmergeObject;
7
+ exports.mergeObject = _chunkNRJPCN4Jcjs.mergeObject;
@@ -1,21 +1,3 @@
1
- /**
2
- * 合并两个对象的值
3
- * @param a 合并到的对象
4
- * @param b 合并对象
5
- * @param j 合并级别
6
- * @param i 是否合并数组
7
- * @returns 合并的对象
8
- */
9
- declare function mergeObject2<T>(a: T, b: T, j?: number, i?: boolean): T;
10
- /**
11
- * 合并两个对象的值
12
- * @param a 合并到的对象
13
- * @param b 合并对象
14
- * @param j 合并级别
15
- * @param i 是否合并数组
16
- * @returns 合并的对象
17
- */
18
- declare function unmergeObject<T>(a: T, b: T, j?: number, i?: boolean): T;
19
1
  /**
20
2
  * 合并两个对象的值
21
3
  * @param a 合并到的对象
@@ -26,4 +8,4 @@ declare function unmergeObject<T>(a: T, b: T, j?: number, i?: boolean): T;
26
8
  */
27
9
  declare function mergeObject<T>(a: T, b: T, j?: number, i?: boolean): T;
28
10
 
29
- export { mergeObject, mergeObject2, unmergeObject };
11
+ export { mergeObject };
@@ -1,11 +1,7 @@
1
1
  import {
2
- mergeObject,
3
- mergeObject2,
4
- unmergeObject
5
- } from "../../chunk-LYFX6BGT.js";
2
+ mergeObject
3
+ } from "../../chunk-RD4EP3M5.js";
6
4
  import "../../chunk-UICA3PK6.js";
7
5
  export {
8
- mergeObject,
9
- mergeObject2,
10
- unmergeObject
6
+ mergeObject
11
7
  };
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunk3VYRYSWKcjs = require('../../chunk-3VYRYSWK.cjs');
4
+ require('../../chunk-5AZGAKWR.cjs');
5
+
6
+
7
+ exports.unmergeObject = _chunk3VYRYSWKcjs.unmergeObject;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * 合并两个对象的值
3
+ * @param a 合并到的对象
4
+ * @param b 合并对象
5
+ * @param j 合并级别
6
+ * @param i 是否合并数组
7
+ * @returns 合并的对象
8
+ */
9
+ declare function unmergeObject<T>(a: T, b: T, j?: number, i?: boolean): T;
10
+
11
+ export { unmergeObject };
@@ -0,0 +1,7 @@
1
+ import {
2
+ unmergeObject
3
+ } from "../../chunk-A6J46LQK.js";
4
+ import "../../chunk-UICA3PK6.js";
5
+ export {
6
+ unmergeObject
7
+ };
@@ -0,0 +1,49 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/basic/object/unmergeObject.ts
2
+ function unmergeObject(a, b, j = 0, i) {
3
+ let c;
4
+ if (a instanceof Array) {
5
+ if (j > 0 && i) {
6
+ c = Object.assign([], a);
7
+ if (b instanceof Array) {
8
+ for (const v of b) {
9
+ if (!a.includes(v)) {
10
+ c.push(v);
11
+ }
12
+ }
13
+ } else {
14
+ if (!a.includes(b)) {
15
+ c.push(b);
16
+ }
17
+ }
18
+ } else {
19
+ c = b;
20
+ }
21
+ } else if (typeof a == "object") {
22
+ const cv = Object.prototype.toString.call(a);
23
+ const ct = Object.prototype.toString.call(b);
24
+ if (a && typeof b == "object" && cv == ct && j > 0) {
25
+ c = { ...a };
26
+ const n = j - 1;
27
+ if (n > 0) {
28
+ for (const key in b) {
29
+ const v = a[key];
30
+ const t = b[key];
31
+ c[key] = unmergeObject(v, t, n, i);
32
+ }
33
+ } else {
34
+ for (const key in b) {
35
+ c[key] = b[key];
36
+ }
37
+ }
38
+ } else {
39
+ c = b;
40
+ }
41
+ } else {
42
+ c = b;
43
+ }
44
+ return c;
45
+ }
46
+
47
+
48
+
49
+ exports.unmergeObject = unmergeObject;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  object_exports
3
- } from "./chunk-AZNBYC7K.js";
3
+ } from "./chunk-MAIGGOA4.js";
4
4
  import {
5
5
  string_exports
6
6
  } from "./chunk-YYNHNLVW.js";
@@ -0,0 +1,49 @@
1
+ // packages/basic/object/unmergeObject.ts
2
+ function unmergeObject(a, b, j = 0, i) {
3
+ let c;
4
+ if (a instanceof Array) {
5
+ if (j > 0 && i) {
6
+ c = Object.assign([], a);
7
+ if (b instanceof Array) {
8
+ for (const v of b) {
9
+ if (!a.includes(v)) {
10
+ c.push(v);
11
+ }
12
+ }
13
+ } else {
14
+ if (!a.includes(b)) {
15
+ c.push(b);
16
+ }
17
+ }
18
+ } else {
19
+ c = b;
20
+ }
21
+ } else if (typeof a == "object") {
22
+ const cv = Object.prototype.toString.call(a);
23
+ const ct = Object.prototype.toString.call(b);
24
+ if (a && typeof b == "object" && cv == ct && j > 0) {
25
+ c = { ...a };
26
+ const n = j - 1;
27
+ if (n > 0) {
28
+ for (const key in b) {
29
+ const v = a[key];
30
+ const t = b[key];
31
+ c[key] = unmergeObject(v, t, n, i);
32
+ }
33
+ } else {
34
+ for (const key in b) {
35
+ c[key] = b[key];
36
+ }
37
+ }
38
+ } else {
39
+ c = b;
40
+ }
41
+ } else {
42
+ c = b;
43
+ }
44
+ return c;
45
+ }
46
+
47
+ export {
48
+ unmergeObject
49
+ };
@@ -1,8 +1,9 @@
1
1
  import {
2
- mergeObject,
3
- mergeObject2,
2
+ mergeObject
3
+ } from "./chunk-RD4EP3M5.js";
4
+ import {
4
5
  unmergeObject
5
- } from "./chunk-LYFX6BGT.js";
6
+ } from "./chunk-A6J46LQK.js";
6
7
  import {
7
8
  isObject
8
9
  } from "./chunk-WO6JQRTD.js";
@@ -15,7 +16,6 @@ var object_exports = {};
15
16
  __export(object_exports, {
16
17
  isObject: () => isObject,
17
18
  mergeObject: () => mergeObject,
18
- mergeObject2: () => mergeObject2,
19
19
  unmergeObject: () => unmergeObject
20
20
  });
21
21
 
@@ -0,0 +1,46 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/basic/object/mergeObject.ts
2
+ function mergeObject(a, b, j = 0, i) {
3
+ if (a instanceof Array) {
4
+ if (j > 0 && i) {
5
+ if (b instanceof Array) {
6
+ for (const v of b) {
7
+ if (!a.includes(v)) {
8
+ a.push(v);
9
+ }
10
+ }
11
+ } else {
12
+ if (!a.includes(b)) {
13
+ a.push(b);
14
+ }
15
+ }
16
+ } else {
17
+ a = b;
18
+ }
19
+ } else if (typeof a == "object") {
20
+ const cv = Object.prototype.toString.call(a);
21
+ const ct = Object.prototype.toString.call(b);
22
+ if (a && typeof b == "object" && cv == ct && j > 0) {
23
+ const n = j - 1;
24
+ if (n > 0) {
25
+ for (const key in b) {
26
+ const v = a[key];
27
+ const t = b[key];
28
+ a[key] = mergeObject(v, t, n, i);
29
+ }
30
+ } else {
31
+ for (const key in b) {
32
+ a[key] = b[key];
33
+ }
34
+ }
35
+ } else {
36
+ a = b;
37
+ }
38
+ } else {
39
+ a = b;
40
+ }
41
+ return a;
42
+ }
43
+
44
+
45
+
46
+ exports.mergeObject = mergeObject;
@@ -1,8 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
+ var _chunkNRJPCN4Jcjs = require('./chunk-NRJPCN4J.cjs');
3
4
 
4
5
 
5
- var _chunkVAYHA5HScjs = require('./chunk-VAYHA5HS.cjs');
6
+ var _chunk3VYRYSWKcjs = require('./chunk-3VYRYSWK.cjs');
6
7
 
7
8
 
8
9
  var _chunkXRGLFTH2cjs = require('./chunk-XRGLFTH2.cjs');
@@ -14,9 +15,8 @@ var _chunk5AZGAKWRcjs = require('./chunk-5AZGAKWR.cjs');
14
15
  var object_exports = {};
15
16
  _chunk5AZGAKWRcjs.__export.call(void 0, object_exports, {
16
17
  isObject: () => _chunkXRGLFTH2cjs.isObject,
17
- mergeObject: () => _chunkVAYHA5HScjs.mergeObject,
18
- mergeObject2: () => _chunkVAYHA5HScjs.mergeObject2,
19
- unmergeObject: () => _chunkVAYHA5HScjs.unmergeObject
18
+ mergeObject: () => _chunkNRJPCN4Jcjs.mergeObject,
19
+ unmergeObject: () => _chunk3VYRYSWKcjs.unmergeObject
20
20
  });
21
21
 
22
22
 
@@ -0,0 +1,46 @@
1
+ // packages/basic/object/mergeObject.ts
2
+ function mergeObject(a, b, j = 0, i) {
3
+ if (a instanceof Array) {
4
+ if (j > 0 && i) {
5
+ if (b instanceof Array) {
6
+ for (const v of b) {
7
+ if (!a.includes(v)) {
8
+ a.push(v);
9
+ }
10
+ }
11
+ } else {
12
+ if (!a.includes(b)) {
13
+ a.push(b);
14
+ }
15
+ }
16
+ } else {
17
+ a = b;
18
+ }
19
+ } else if (typeof a == "object") {
20
+ const cv = Object.prototype.toString.call(a);
21
+ const ct = Object.prototype.toString.call(b);
22
+ if (a && typeof b == "object" && cv == ct && j > 0) {
23
+ const n = j - 1;
24
+ if (n > 0) {
25
+ for (const key in b) {
26
+ const v = a[key];
27
+ const t = b[key];
28
+ a[key] = mergeObject(v, t, n, i);
29
+ }
30
+ } else {
31
+ for (const key in b) {
32
+ a[key] = b[key];
33
+ }
34
+ }
35
+ } else {
36
+ a = b;
37
+ }
38
+ } else {
39
+ a = b;
40
+ }
41
+ return a;
42
+ }
43
+
44
+ export {
45
+ mergeObject
46
+ };
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkYZULJRHHcjs = require('./chunk-YZULJRHH.cjs');
3
+ var _chunkR7G5MSGOcjs = require('./chunk-R7G5MSGO.cjs');
4
4
 
5
5
 
6
6
  var _chunk4PBAZ73Icjs = require('./chunk-4PBAZ73I.cjs');
@@ -15,7 +15,7 @@ var _chunk5AZGAKWRcjs = require('./chunk-5AZGAKWR.cjs');
15
15
  var basic_exports = {};
16
16
  _chunk5AZGAKWRcjs.__export.call(void 0, basic_exports, {
17
17
  array: () => _chunkJNC5JEFBcjs.array_exports,
18
- object: () => _chunkYZULJRHHcjs.object_exports,
18
+ object: () => _chunkR7G5MSGOcjs.object_exports,
19
19
  string: () => _chunk4PBAZ73Icjs.string_exports
20
20
  });
21
21
 
@@ -1,5 +1,5 @@
1
1
  import { i as index$1 } from './index-6be6487f.js';
2
- import { i as index$2 } from './index-5c5bf158.js';
2
+ import { i as index$2 } from './index-8473d4b5.js';
3
3
  import { i as index$3 } from './index-5691335a.js';
4
4
 
5
5
  declare namespace index {
@@ -1,15 +1,14 @@
1
+ import { mergeObject } from './basic/object/mergeObject.js';
1
2
  import { isObject } from './basic/object/isObject.js';
2
- import { mergeObject, mergeObject2, unmergeObject } from './basic/object/mergeObject.js';
3
+ import { unmergeObject } from './basic/object/unmergeObject.js';
3
4
 
4
5
  declare const index_isObject: typeof isObject;
5
6
  declare const index_mergeObject: typeof mergeObject;
6
- declare const index_mergeObject2: typeof mergeObject2;
7
7
  declare const index_unmergeObject: typeof unmergeObject;
8
8
  declare namespace index {
9
9
  export {
10
10
  index_isObject as isObject,
11
11
  index_mergeObject as mergeObject,
12
- index_mergeObject2 as mergeObject2,
13
12
  index_unmergeObject as unmergeObject,
14
13
  };
15
14
  }
package/dist/index.cjs CHANGED
@@ -1,8 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkJ53DPBUNcjs = require('./chunk-J53DPBUN.cjs');
4
- require('./chunk-YZULJRHH.cjs');
5
- require('./chunk-VAYHA5HS.cjs');
3
+ var _chunkYBUHXX5Ucjs = require('./chunk-YBUHXX5U.cjs');
4
+ require('./chunk-R7G5MSGO.cjs');
5
+ require('./chunk-NRJPCN4J.cjs');
6
+ require('./chunk-3VYRYSWK.cjs');
6
7
  require('./chunk-4PBAZ73I.cjs');
7
8
  require('./chunk-BEQYORII.cjs');
8
9
 
@@ -21,4 +22,4 @@ require('./chunk-5AZGAKWR.cjs');
21
22
 
22
23
 
23
24
 
24
- exports.basic = _chunkJ53DPBUNcjs.basic_exports; exports.iss = _chunkN6OX2U6Wcjs.iss_exports; exports.log = _chunkJ7SPTSZMcjs.log_exports;
25
+ exports.basic = _chunkYBUHXX5Ucjs.basic_exports; exports.iss = _chunkN6OX2U6Wcjs.iss_exports; exports.log = _chunkJ7SPTSZMcjs.log_exports;
package/dist/index.d.ts CHANGED
@@ -1,12 +1,13 @@
1
- export { i as basic } from './index-8abebe13.js';
1
+ export { i as basic } from './index-56b2efa3.js';
2
2
  export { i as iss } from './index-24872dab.js';
3
3
  export { i as log } from './index-ef15848a.js';
4
4
  import './index-6be6487f.js';
5
5
  import './basic/array/isArray.js';
6
6
  import './basic/array/toggleArray.js';
7
- import './index-5c5bf158.js';
8
- import './basic/object/isObject.js';
7
+ import './index-8473d4b5.js';
9
8
  import './basic/object/mergeObject.js';
9
+ import './basic/object/isObject.js';
10
+ import './basic/object/unmergeObject.js';
10
11
  import './index-5691335a.js';
11
12
  import './basic/string/index2.js';
12
13
  import './log/styleLog.js';
package/dist/index.js CHANGED
@@ -1,8 +1,9 @@
1
1
  import {
2
2
  basic_exports
3
- } from "./chunk-P33DGEQL.js";
4
- import "./chunk-AZNBYC7K.js";
5
- import "./chunk-LYFX6BGT.js";
3
+ } from "./chunk-75TBDXR6.js";
4
+ import "./chunk-MAIGGOA4.js";
5
+ import "./chunk-RD4EP3M5.js";
6
+ import "./chunk-A6J46LQK.js";
6
7
  import "./chunk-YYNHNLVW.js";
7
8
  import "./chunk-DEENZC5X.js";
8
9
  import {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fangzhongya/utils",
3
3
  "private": false,
4
4
  "type": "module",
5
- "version": "0.0.5",
5
+ "version": "0.0.6",
6
6
  "description ": "个人工具库",
7
7
  "author": "fangzhongya ",
8
8
  "license": "MIT",
@@ -23,15 +23,12 @@
23
23
  "test": "vitest test"
24
24
  },
25
25
  "devDependencies": {
26
- "@fangzhongya/create": "^0.1.0",
27
- "@types/node": "^18.11.18",
26
+ "@fangzhongya/create": "0.1.5-3",
27
+ "@types/node": "^18.11.19",
28
28
  "tsup": "^6.5.0",
29
29
  "typescript": "^4.9.5",
30
30
  "vitest": "^0.28.4"
31
31
  },
32
- "main": "./dist/index.cjs",
33
- "module": "./dist/index.js",
34
- "types": "./dist/index.d.ts",
35
32
  "typesVersions": {
36
33
  "*": {
37
34
  "*": [
@@ -43,11 +40,6 @@
43
40
  "dist"
44
41
  ],
45
42
  "exports": {
46
- ".": {
47
- "require": "./dist/index.cjs",
48
- "import": "./dist/index.js",
49
- "types": "./dist/index.d.ts"
50
- },
51
43
  "./basic/array": {
52
44
  "require": "./dist/basic/array/index.cjs",
53
45
  "import": "./dist/basic/array/index.js",
@@ -68,15 +60,20 @@
68
60
  "import": "./dist/basic/object/index.js",
69
61
  "types": "./dist/basic/object/index.d.ts"
70
62
  },
63
+ "./basic/object/isObject": {
64
+ "require": "./dist/basic/object/isObject.cjs",
65
+ "import": "./dist/basic/object/isObject.js",
66
+ "types": "./dist/basic/object/isObject.d.ts"
67
+ },
71
68
  "./basic/object/mergeObject": {
72
69
  "require": "./dist/basic/object/mergeObject.cjs",
73
70
  "import": "./dist/basic/object/mergeObject.js",
74
71
  "types": "./dist/basic/object/mergeObject.d.ts"
75
72
  },
76
- "./basic/object/isObject": {
77
- "require": "./dist/basic/object/isObject.cjs",
78
- "import": "./dist/basic/object/isObject.js",
79
- "types": "./dist/basic/object/isObject.d.ts"
73
+ "./basic/object/unmergeObject": {
74
+ "require": "./dist/basic/object/unmergeObject.cjs",
75
+ "import": "./dist/basic/object/unmergeObject.js",
76
+ "types": "./dist/basic/object/unmergeObject.d.ts"
80
77
  },
81
78
  "./basic/string": {
82
79
  "require": "./dist/basic/string/index.cjs",
@@ -93,15 +90,28 @@
93
90
  "import": "./dist/basic/index.js",
94
91
  "types": "./dist/basic/index.d.ts"
95
92
  },
96
- "./iss": {
97
- "require": "./dist/iss/index.cjs",
98
- "import": "./dist/iss/index.js",
99
- "types": "./dist/iss/index.d.ts"
93
+ "./log": {
94
+ "require": "./dist/log/index.cjs",
95
+ "import": "./dist/log/index.js",
96
+ "types": "./dist/log/index.d.ts"
100
97
  },
101
98
  "./log/styleLog": {
102
99
  "require": "./dist/log/styleLog.cjs",
103
100
  "import": "./dist/log/styleLog.js",
104
101
  "types": "./dist/log/styleLog.d.ts"
102
+ },
103
+ "./iss": {
104
+ "require": "./dist/iss/index.cjs",
105
+ "import": "./dist/iss/index.js",
106
+ "types": "./dist/iss/index.d.ts"
107
+ },
108
+ ".": {
109
+ "require": "./dist/index.cjs",
110
+ "import": "./dist/index.js",
111
+ "types": "./dist/index.d.ts"
105
112
  }
106
- }
107
- }
113
+ },
114
+ "main": "./dist/index.cjs",
115
+ "module": "./dist/index.js",
116
+ "types": "./dist/index.d.ts"
117
+ }
@@ -1,129 +0,0 @@
1
- // packages/basic/object/mergeObject.ts
2
- function mergeObject2(a, b, j = 1, i) {
3
- for (const key in b) {
4
- const v = a[key];
5
- const t = b[key];
6
- if (v) {
7
- if (v instanceof Array) {
8
- if (i) {
9
- if (t instanceof Array) {
10
- v.push(...t);
11
- } else {
12
- v.push(t);
13
- }
14
- } else {
15
- a[key] = t;
16
- }
17
- } else if (typeof v == "object") {
18
- const cv = Object.prototype.toString.call(v);
19
- const ct = Object.prototype.toString.call(t);
20
- if (cv == ct) {
21
- const n = j - 1;
22
- if (n > 0) {
23
- a[key] = mergeObject2(v, t, n, i);
24
- } else {
25
- a[key] = t;
26
- }
27
- } else {
28
- a[key] = t;
29
- }
30
- } else {
31
- a[key] = t;
32
- }
33
- } else {
34
- a[key] = t;
35
- }
36
- }
37
- return a;
38
- }
39
- function unmergeObject(a, b, j = 0, i) {
40
- let c;
41
- if (a instanceof Array) {
42
- if (j > 0 && i) {
43
- c = Object.assign([], a);
44
- if (b instanceof Array) {
45
- for (const v of b) {
46
- if (!a.includes(v)) {
47
- c.push(v);
48
- }
49
- }
50
- } else {
51
- if (!a.includes(b)) {
52
- c.push(b);
53
- }
54
- }
55
- } else {
56
- c = b;
57
- }
58
- } else if (typeof a == "object") {
59
- const cv = Object.prototype.toString.call(a);
60
- const ct = Object.prototype.toString.call(b);
61
- if (a && typeof b == "object" && cv == ct && j > 0) {
62
- c = { ...a };
63
- const n = j - 1;
64
- if (n > 0) {
65
- for (const key in b) {
66
- const v = a[key];
67
- const t = b[key];
68
- c[key] = mergeObject(v, t, n, i);
69
- }
70
- } else {
71
- for (const key in b) {
72
- c[key] = b[key];
73
- }
74
- }
75
- } else {
76
- c = b;
77
- }
78
- } else {
79
- c = b;
80
- }
81
- return c;
82
- }
83
- function mergeObject(a, b, j = 0, i) {
84
- if (a instanceof Array) {
85
- if (j > 0 && i) {
86
- if (b instanceof Array) {
87
- for (const v of b) {
88
- if (!a.includes(v)) {
89
- a.push(v);
90
- }
91
- }
92
- } else {
93
- if (!a.includes(b)) {
94
- a.push(b);
95
- }
96
- }
97
- } else {
98
- a = b;
99
- }
100
- } else if (typeof a == "object") {
101
- const cv = Object.prototype.toString.call(a);
102
- const ct = Object.prototype.toString.call(b);
103
- if (a && typeof b == "object" && cv == ct && j > 0) {
104
- const n = j - 1;
105
- if (n > 0) {
106
- for (const key in b) {
107
- const v = a[key];
108
- const t = b[key];
109
- a[key] = mergeObject(v, t, n, i);
110
- }
111
- } else {
112
- for (const key in b) {
113
- a[key] = b[key];
114
- }
115
- }
116
- } else {
117
- a = b;
118
- }
119
- } else {
120
- a = b;
121
- }
122
- return a;
123
- }
124
-
125
- export {
126
- mergeObject2,
127
- unmergeObject,
128
- mergeObject
129
- };
@@ -1,129 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/basic/object/mergeObject.ts
2
- function mergeObject2(a, b, j = 1, i) {
3
- for (const key in b) {
4
- const v = a[key];
5
- const t = b[key];
6
- if (v) {
7
- if (v instanceof Array) {
8
- if (i) {
9
- if (t instanceof Array) {
10
- v.push(...t);
11
- } else {
12
- v.push(t);
13
- }
14
- } else {
15
- a[key] = t;
16
- }
17
- } else if (typeof v == "object") {
18
- const cv = Object.prototype.toString.call(v);
19
- const ct = Object.prototype.toString.call(t);
20
- if (cv == ct) {
21
- const n = j - 1;
22
- if (n > 0) {
23
- a[key] = mergeObject2(v, t, n, i);
24
- } else {
25
- a[key] = t;
26
- }
27
- } else {
28
- a[key] = t;
29
- }
30
- } else {
31
- a[key] = t;
32
- }
33
- } else {
34
- a[key] = t;
35
- }
36
- }
37
- return a;
38
- }
39
- function unmergeObject(a, b, j = 0, i) {
40
- let c;
41
- if (a instanceof Array) {
42
- if (j > 0 && i) {
43
- c = Object.assign([], a);
44
- if (b instanceof Array) {
45
- for (const v of b) {
46
- if (!a.includes(v)) {
47
- c.push(v);
48
- }
49
- }
50
- } else {
51
- if (!a.includes(b)) {
52
- c.push(b);
53
- }
54
- }
55
- } else {
56
- c = b;
57
- }
58
- } else if (typeof a == "object") {
59
- const cv = Object.prototype.toString.call(a);
60
- const ct = Object.prototype.toString.call(b);
61
- if (a && typeof b == "object" && cv == ct && j > 0) {
62
- c = { ...a };
63
- const n = j - 1;
64
- if (n > 0) {
65
- for (const key in b) {
66
- const v = a[key];
67
- const t = b[key];
68
- c[key] = mergeObject(v, t, n, i);
69
- }
70
- } else {
71
- for (const key in b) {
72
- c[key] = b[key];
73
- }
74
- }
75
- } else {
76
- c = b;
77
- }
78
- } else {
79
- c = b;
80
- }
81
- return c;
82
- }
83
- function mergeObject(a, b, j = 0, i) {
84
- if (a instanceof Array) {
85
- if (j > 0 && i) {
86
- if (b instanceof Array) {
87
- for (const v of b) {
88
- if (!a.includes(v)) {
89
- a.push(v);
90
- }
91
- }
92
- } else {
93
- if (!a.includes(b)) {
94
- a.push(b);
95
- }
96
- }
97
- } else {
98
- a = b;
99
- }
100
- } else if (typeof a == "object") {
101
- const cv = Object.prototype.toString.call(a);
102
- const ct = Object.prototype.toString.call(b);
103
- if (a && typeof b == "object" && cv == ct && j > 0) {
104
- const n = j - 1;
105
- if (n > 0) {
106
- for (const key in b) {
107
- const v = a[key];
108
- const t = b[key];
109
- a[key] = mergeObject(v, t, n, i);
110
- }
111
- } else {
112
- for (const key in b) {
113
- a[key] = b[key];
114
- }
115
- }
116
- } else {
117
- a = b;
118
- }
119
- } else {
120
- a = b;
121
- }
122
- return a;
123
- }
124
-
125
-
126
-
127
-
128
-
129
- exports.mergeObject2 = mergeObject2; exports.unmergeObject = unmergeObject; exports.mergeObject = mergeObject;