@fangzhongya/utils 0.0.49 → 0.0.55

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.
Files changed (74) hide show
  1. package/dist/basic/array/index.cjs +4 -4
  2. package/dist/basic/array/index.js +4 -4
  3. package/dist/basic/index.cjs +23 -22
  4. package/dist/basic/index.d.cts +2 -1
  5. package/dist/basic/index.d.ts +2 -1
  6. package/dist/basic/index.js +22 -21
  7. package/dist/basic/object/deepCopys.cjs +17 -0
  8. package/dist/basic/object/deepCopys.d.cts +31 -0
  9. package/dist/basic/object/deepCopys.d.ts +31 -0
  10. package/dist/basic/object/deepCopys.js +17 -0
  11. package/dist/basic/object/index.cjs +24 -10
  12. package/dist/basic/object/index.d.cts +1 -0
  13. package/dist/basic/object/index.d.ts +1 -0
  14. package/dist/basic/object/index.js +27 -13
  15. package/dist/basic/string/index.cjs +11 -11
  16. package/dist/basic/string/index.js +12 -12
  17. package/dist/basic/string/toJsons.cjs +3 -3
  18. package/dist/basic/string/toJsons.js +2 -2
  19. package/dist/{chunk-FKO3U4EX.js → chunk-6BFEQDEL.js} +26 -12
  20. package/dist/chunk-75UYCE4X.cjs +10 -0
  21. package/dist/{chunk-F7MR5E6C.js → chunk-7EHG5A4B.js} +10 -10
  22. package/dist/{chunk-P3A5IQ5U.cjs → chunk-7NEXCOZZ.cjs} +4 -0
  23. package/dist/{chunk-DQR27XZK.cjs → chunk-7RFWR2DR.cjs} +12 -12
  24. package/dist/{chunk-UHKL2RG3.cjs → chunk-FL2HPQ66.cjs} +5 -5
  25. package/dist/chunk-G7BRLTGL.cjs +24 -0
  26. package/dist/{chunk-AM754I6W.cjs → chunk-IODGCXUS.cjs} +22 -8
  27. package/dist/{chunk-VJA6UBID.js → chunk-JPQN3LUH.js} +4 -0
  28. package/dist/{chunk-67PFQHTN.js → chunk-MNS676PI.js} +5 -5
  29. package/dist/chunk-Q2EFMBMD.js +10 -0
  30. package/dist/chunk-SJ74DU4B.cjs +275 -0
  31. package/dist/{chunk-YKNGDK4I.js → chunk-X44UO4CZ.js} +4 -4
  32. package/dist/chunk-YMKTU42G.js +275 -0
  33. package/dist/date/getEndOfDay.cjs +7 -0
  34. package/dist/date/getEndOfDay.d.cts +3 -0
  35. package/dist/date/getEndOfDay.d.ts +3 -0
  36. package/dist/date/getEndOfDay.js +7 -0
  37. package/dist/date/index.cjs +6 -2
  38. package/dist/date/index.d.cts +1 -0
  39. package/dist/date/index.d.ts +1 -0
  40. package/dist/date/index.js +5 -1
  41. package/dist/html/index.cjs +5 -5
  42. package/dist/html/index.js +5 -5
  43. package/dist/{index-sQs-LFc_.d.ts → index-BFahmWSa.d.ts} +3 -1
  44. package/dist/{index-BHI-3z9i.d.cts → index-Cz8fWd5l.d.cts} +8 -1
  45. package/dist/{index-C6fjPfzn.d.ts → index-J-xiEtN9.d.ts} +1 -1
  46. package/dist/{index-DYRjlOZp.d.cts → index-KftqgSWD.d.cts} +1 -1
  47. package/dist/{index-qKkaUBR7.d.ts → index-oW2flHUo.d.ts} +8 -1
  48. package/dist/{index-CNiivy3_.d.cts → index-x-yhJQ-1.d.cts} +3 -1
  49. package/dist/index.cjs +52 -50
  50. package/dist/index.d.cts +5 -3
  51. package/dist/index.d.ts +5 -3
  52. package/dist/index.js +53 -51
  53. package/dist/judge/index.cjs +6 -6
  54. package/dist/judge/index.js +5 -5
  55. package/dist/judge/matchs.cjs +3 -3
  56. package/dist/judge/matchs.js +2 -2
  57. package/dist/name/index.cjs +3 -3
  58. package/dist/name/index.js +4 -4
  59. package/dist/window/index.cjs +4 -4
  60. package/dist/window/index.js +7 -7
  61. package/package.json +593 -583
  62. package/dist/chunk-73ZAOXP3.cjs +0 -24
  63. package/dist/{chunk-T2QKEABG.js → chunk-33X65PQS.js} +3 -3
  64. package/dist/{chunk-T22I7TJQ.cjs → chunk-3YUI42XN.cjs} +3 -3
  65. package/dist/{chunk-6K32ZUJG.js → chunk-4JXZQBCA.js} +4 -4
  66. package/dist/{chunk-HPQRTXFK.cjs → chunk-65O7KWP4.cjs} +3 -3
  67. package/dist/{chunk-E74ZD4NG.cjs → chunk-72GMBSE6.cjs} +3 -3
  68. package/dist/{chunk-IVDRKJ33.js → chunk-BFN33JM5.js} +3 -3
  69. package/dist/{chunk-ZXWKQRGH.cjs → chunk-BG2YS767.cjs} +2 -2
  70. package/dist/{chunk-SGYFZFWD.cjs → chunk-FLGYKRQ6.cjs} +4 -4
  71. package/dist/{chunk-5HC662VK.js → chunk-I5D6RCLU.js} +3 -3
  72. package/dist/{chunk-ETMYYVQJ.cjs → chunk-L6JTKQ65.cjs} +2 -2
  73. package/dist/{chunk-5WQXANBO.js → chunk-MZLWYQQH.js} +6 -6
  74. package/dist/{chunk-HAXXG6HP.js → chunk-PVXQ2H5H.js} +3 -3
@@ -1,10 +1,3 @@
1
- import {
2
- mergeObject
3
- } from "./chunk-RD4EP3M5.js";
4
- import {
5
- getObjValue,
6
- setObjValue
7
- } from "./chunk-754Z5VW6.js";
8
1
  import {
9
2
  reverseObj
10
3
  } from "./chunk-B3IGSYZT.js";
@@ -14,21 +7,36 @@ import {
14
7
  import {
15
8
  unmergeObject
16
9
  } from "./chunk-A6J46LQK.js";
10
+ import {
11
+ getSort
12
+ } from "./chunk-ZEAT23CI.js";
13
+ import {
14
+ hasOwn
15
+ } from "./chunk-3IR2ABRO.js";
16
+ import {
17
+ mergeObject
18
+ } from "./chunk-RD4EP3M5.js";
17
19
  import {
18
20
  attrValueSort
19
21
  } from "./chunk-T4BAVDTH.js";
20
22
  import {
21
23
  deepCopy
22
24
  } from "./chunk-PHKZER72.js";
25
+ import {
26
+ deepCopys,
27
+ fastDeepCopy,
28
+ isPlainObject,
29
+ safeDeepCopy,
30
+ simpleDeepCopy,
31
+ structuredCloneCopy
32
+ } from "./chunk-YMKTU42G.js";
23
33
  import {
24
34
  filterObject
25
35
  } from "./chunk-S42NGJ5W.js";
26
36
  import {
27
- getSort
28
- } from "./chunk-ZEAT23CI.js";
29
- import {
30
- hasOwn
31
- } from "./chunk-3IR2ABRO.js";
37
+ getObjValue,
38
+ setObjValue
39
+ } from "./chunk-754Z5VW6.js";
32
40
  import {
33
41
  isEqual,
34
42
  isEqualEnhanced
@@ -48,6 +56,8 @@ var object_exports = {};
48
56
  __export(object_exports, {
49
57
  attrValueSort: () => attrValueSort,
50
58
  deepCopy: () => deepCopy,
59
+ deepCopys: () => deepCopys,
60
+ fastDeepCopy: () => fastDeepCopy,
51
61
  filterObject: () => filterObject,
52
62
  getObjValue: () => getObjValue,
53
63
  getSort: () => getSort,
@@ -56,10 +66,14 @@ __export(object_exports, {
56
66
  isEqualEnhanced: () => isEqualEnhanced,
57
67
  isObject: () => isObject,
58
68
  isObjectArray: () => isObjectArray,
69
+ isPlainObject: () => isPlainObject,
59
70
  mergeObject: () => mergeObject,
60
71
  reverseObj: () => reverseObj,
72
+ safeDeepCopy: () => safeDeepCopy,
61
73
  setObjValue: () => setObjValue,
62
74
  setSort: () => setSort,
75
+ simpleDeepCopy: () => simpleDeepCopy,
76
+ structuredCloneCopy: () => structuredCloneCopy,
63
77
  unmergeObject: () => unmergeObject
64
78
  });
65
79
 
@@ -0,0 +1,10 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/date/getEndOfDay.ts
2
+ function getEndOfDay(date = /* @__PURE__ */ new Date()) {
3
+ const endOfDay = new Date(date);
4
+ endOfDay.setHours(23, 59, 59, 999);
5
+ return endOfDay;
6
+ }
7
+
8
+
9
+
10
+ exports.getEndOfDay = getEndOfDay;
@@ -1,9 +1,3 @@
1
- import {
2
- toStringParse
3
- } from "./chunk-MGK5PCGH.js";
4
- import {
5
- splitUpper
6
- } from "./chunk-VKE5JARB.js";
7
1
  import {
8
2
  toJSONParse,
9
3
  toJSONStringify
@@ -13,7 +7,10 @@ import {
13
7
  serializeFunctionRef,
14
8
  toJSONSParse,
15
9
  toJSONSStringify
16
- } from "./chunk-5HC662VK.js";
10
+ } from "./chunk-I5D6RCLU.js";
11
+ import {
12
+ toStringParse
13
+ } from "./chunk-MGK5PCGH.js";
17
14
  import {
18
15
  getFunctionFormat,
19
16
  toFunction
@@ -25,12 +22,15 @@ import {
25
22
  getImports,
26
23
  getImportss
27
24
  } from "./chunk-N5Y3XGHX.js";
28
- import {
29
- deComment
30
- } from "./chunk-FS4JPT23.js";
31
25
  import {
32
26
  getStartSame
33
27
  } from "./chunk-7DTHADVK.js";
28
+ import {
29
+ splitUpper
30
+ } from "./chunk-VKE5JARB.js";
31
+ import {
32
+ deComment
33
+ } from "./chunk-FS4JPT23.js";
34
34
  import {
35
35
  getStrNunPosit
36
36
  } from "./chunk-USIMBBLW.js";
@@ -4,6 +4,9 @@
4
4
  var _chunk7TGGIID4cjs = require('./chunk-7TGGIID4.cjs');
5
5
 
6
6
 
7
+ var _chunk75UYCE4Xcjs = require('./chunk-75UYCE4X.cjs');
8
+
9
+
7
10
  var _chunkZ2EAQZ47cjs = require('./chunk-Z2EAQZ47.cjs');
8
11
 
9
12
 
@@ -13,6 +16,7 @@ var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
13
16
  var date_exports = {};
14
17
  _chunk75ZPJI57cjs.__export.call(void 0, date_exports, {
15
18
  format: () => _chunk7TGGIID4cjs.format,
19
+ getEndOfDay: () => _chunk75UYCE4Xcjs.getEndOfDay,
16
20
  hourFormat: () => _chunkZ2EAQZ47cjs.hourFormat,
17
21
  parseDateString: () => _chunk7TGGIID4cjs.parseDateString
18
22
  });
@@ -1,19 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkXG44HG5Ncjs = require('./chunk-XG44HG5N.cjs');
4
-
5
-
6
- var _chunkL7FSHU27cjs = require('./chunk-L7FSHU27.cjs');
7
3
 
4
+ var _chunkJHV27P2Qcjs = require('./chunk-JHV27P2Q.cjs');
8
5
 
9
6
 
10
- var _chunkJHV27P2Qcjs = require('./chunk-JHV27P2Q.cjs');
11
7
 
12
8
 
13
9
 
10
+ var _chunkL6JTKQ65cjs = require('./chunk-L6JTKQ65.cjs');
14
11
 
15
12
 
16
- var _chunkETMYYVQJcjs = require('./chunk-ETMYYVQJ.cjs');
13
+ var _chunkXG44HG5Ncjs = require('./chunk-XG44HG5N.cjs');
17
14
 
18
15
 
19
16
 
@@ -27,10 +24,13 @@ var _chunkFQCXDJQ3cjs = require('./chunk-FQCXDJQ3.cjs');
27
24
  var _chunkHWHYHL6Jcjs = require('./chunk-HWHYHL6J.cjs');
28
25
 
29
26
 
30
- var _chunkXWCRGY54cjs = require('./chunk-XWCRGY54.cjs');
27
+ var _chunkJ7S3KBHLcjs = require('./chunk-J7S3KBHL.cjs');
31
28
 
32
29
 
33
- var _chunkJ7S3KBHLcjs = require('./chunk-J7S3KBHL.cjs');
30
+ var _chunkL7FSHU27cjs = require('./chunk-L7FSHU27.cjs');
31
+
32
+
33
+ var _chunkXWCRGY54cjs = require('./chunk-XWCRGY54.cjs');
34
34
 
35
35
 
36
36
  var _chunk2H3KVSFAcjs = require('./chunk-2H3KVSFA.cjs');
@@ -71,14 +71,14 @@ _chunk75ZPJI57cjs.__export.call(void 0, string_exports, {
71
71
  getStartSame: () => _chunkJ7S3KBHLcjs.getStartSame,
72
72
  getStartSames: () => _chunkPW7RP73Jcjs.getStartSames,
73
73
  getStrNunPosit: () => _chunk2H3KVSFAcjs.getStrNunPosit,
74
- serializeCodeBlock: () => _chunkETMYYVQJcjs.serializeCodeBlock,
75
- serializeFunctionRef: () => _chunkETMYYVQJcjs.serializeFunctionRef,
74
+ serializeCodeBlock: () => _chunkL6JTKQ65cjs.serializeCodeBlock,
75
+ serializeFunctionRef: () => _chunkL6JTKQ65cjs.serializeFunctionRef,
76
76
  splitUpper: () => _chunkL7FSHU27cjs.splitUpper,
77
77
  startsNum: () => _chunkILJLXJ5Ocjs.startsNum,
78
78
  toFunction: () => _chunkQXK4IUBIcjs.toFunction,
79
79
  toJSONParse: () => _chunkJHV27P2Qcjs.toJSONParse,
80
- toJSONSParse: () => _chunkETMYYVQJcjs.toJSONSParse,
81
- toJSONSStringify: () => _chunkETMYYVQJcjs.toJSONSStringify,
80
+ toJSONSParse: () => _chunkL6JTKQ65cjs.toJSONSParse,
81
+ toJSONSStringify: () => _chunkL6JTKQ65cjs.toJSONSStringify,
82
82
  toJSONStringify: () => _chunkJHV27P2Qcjs.toJSONStringify,
83
83
  toStringParse: () => _chunkXG44HG5Ncjs.toStringParse
84
84
  });
@@ -27,16 +27,16 @@
27
27
  var _chunkV2DXOH6Bcjs = require('./chunk-V2DXOH6B.cjs');
28
28
 
29
29
 
30
- var _chunkT22I7TJQcjs = require('./chunk-T22I7TJQ.cjs');
30
+ var _chunk3YUI42XNcjs = require('./chunk-3YUI42XN.cjs');
31
31
 
32
32
 
33
- var _chunkYGJOBIEOcjs = require('./chunk-YGJOBIEO.cjs');
33
+ var _chunk2BY5RQHUcjs = require('./chunk-2BY5RQHU.cjs');
34
34
 
35
35
 
36
- var _chunkZZEFL2TEcjs = require('./chunk-ZZEFL2TE.cjs');
36
+ var _chunkYGJOBIEOcjs = require('./chunk-YGJOBIEO.cjs');
37
37
 
38
38
 
39
- var _chunk2BY5RQHUcjs = require('./chunk-2BY5RQHU.cjs');
39
+ var _chunkZZEFL2TEcjs = require('./chunk-ZZEFL2TE.cjs');
40
40
 
41
41
 
42
42
  var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
@@ -69,7 +69,7 @@ _chunk75ZPJI57cjs.__export.call(void 0, judge_exports, {
69
69
  isTel: () => _chunkV2DXOH6Bcjs.isTel,
70
70
  isURL: () => _chunkV2DXOH6Bcjs.isURL,
71
71
  isWeChat: () => _chunkV2DXOH6Bcjs.isWeChat,
72
- matchs: () => _chunkT22I7TJQcjs.matchs,
72
+ matchs: () => _chunk3YUI42XNcjs.matchs,
73
73
  matchsEnd: () => _chunkYGJOBIEOcjs.matchsEnd,
74
74
  matchsStart: () => _chunkZZEFL2TEcjs.matchsStart,
75
75
  matchsWhole: () => _chunk2BY5RQHUcjs.matchsWhole
@@ -0,0 +1,24 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkIODGCXUScjs = require('./chunk-IODGCXUS.cjs');
4
+
5
+
6
+ var _chunk7RFWR2DRcjs = require('./chunk-7RFWR2DR.cjs');
7
+
8
+
9
+ var _chunk65O7KWP4cjs = require('./chunk-65O7KWP4.cjs');
10
+
11
+
12
+ var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
13
+
14
+ // packages/basic/index.ts
15
+ var basic_exports = {};
16
+ _chunk75ZPJI57cjs.__export.call(void 0, basic_exports, {
17
+ array: () => _chunk65O7KWP4cjs.array_exports,
18
+ object: () => _chunkIODGCXUScjs.object_exports,
19
+ string: () => _chunk7RFWR2DRcjs.string_exports
20
+ });
21
+
22
+
23
+
24
+ exports.basic_exports = basic_exports;
@@ -1,19 +1,21 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkNRJPCN4Jcjs = require('./chunk-NRJPCN4J.cjs');
3
+ var _chunkSLXKYTEUcjs = require('./chunk-SLXKYTEU.cjs');
4
4
 
5
5
 
6
+ var _chunkIIKQHLKTcjs = require('./chunk-IIKQHLKT.cjs');
6
7
 
7
- var _chunkE4WBX6J5cjs = require('./chunk-E4WBX6J5.cjs');
8
8
 
9
+ var _chunk3VYRYSWKcjs = require('./chunk-3VYRYSWK.cjs');
9
10
 
10
- var _chunkSLXKYTEUcjs = require('./chunk-SLXKYTEU.cjs');
11
11
 
12
+ var _chunk7AIT4XSDcjs = require('./chunk-7AIT4XSD.cjs');
12
13
 
13
- var _chunkIIKQHLKTcjs = require('./chunk-IIKQHLKT.cjs');
14
+
15
+ var _chunkGOUC2DFAcjs = require('./chunk-GOUC2DFA.cjs');
14
16
 
15
17
 
16
- var _chunk3VYRYSWKcjs = require('./chunk-3VYRYSWK.cjs');
18
+ var _chunkNRJPCN4Jcjs = require('./chunk-NRJPCN4J.cjs');
17
19
 
18
20
 
19
21
  var _chunkUFYLVZNUcjs = require('./chunk-UFYLVZNU.cjs');
@@ -22,13 +24,19 @@ var _chunkUFYLVZNUcjs = require('./chunk-UFYLVZNU.cjs');
22
24
  var _chunkCDQONLGUcjs = require('./chunk-CDQONLGU.cjs');
23
25
 
24
26
 
25
- var _chunkD3SX7OUVcjs = require('./chunk-D3SX7OUV.cjs');
26
27
 
27
28
 
28
- var _chunk7AIT4XSDcjs = require('./chunk-7AIT4XSD.cjs');
29
29
 
30
30
 
31
- var _chunkGOUC2DFAcjs = require('./chunk-GOUC2DFA.cjs');
31
+
32
+ var _chunkSJ74DU4Bcjs = require('./chunk-SJ74DU4B.cjs');
33
+
34
+
35
+ var _chunkD3SX7OUVcjs = require('./chunk-D3SX7OUV.cjs');
36
+
37
+
38
+
39
+ var _chunkE4WBX6J5cjs = require('./chunk-E4WBX6J5.cjs');
32
40
 
33
41
 
34
42
 
@@ -48,6 +56,8 @@ var object_exports = {};
48
56
  _chunk75ZPJI57cjs.__export.call(void 0, object_exports, {
49
57
  attrValueSort: () => _chunkUFYLVZNUcjs.attrValueSort,
50
58
  deepCopy: () => _chunkCDQONLGUcjs.deepCopy,
59
+ deepCopys: () => _chunkSJ74DU4Bcjs.deepCopys,
60
+ fastDeepCopy: () => _chunkSJ74DU4Bcjs.fastDeepCopy,
51
61
  filterObject: () => _chunkD3SX7OUVcjs.filterObject,
52
62
  getObjValue: () => _chunkE4WBX6J5cjs.getObjValue,
53
63
  getSort: () => _chunk7AIT4XSDcjs.getSort,
@@ -56,10 +66,14 @@ _chunk75ZPJI57cjs.__export.call(void 0, object_exports, {
56
66
  isEqualEnhanced: () => _chunkWWAPPA4Ecjs.isEqualEnhanced,
57
67
  isObject: () => _chunkMIC3W2VYcjs.isObject,
58
68
  isObjectArray: () => _chunkA5LHXE5Xcjs.isObjectArray,
69
+ isPlainObject: () => _chunkSJ74DU4Bcjs.isPlainObject,
59
70
  mergeObject: () => _chunkNRJPCN4Jcjs.mergeObject,
60
71
  reverseObj: () => _chunkSLXKYTEUcjs.reverseObj,
72
+ safeDeepCopy: () => _chunkSJ74DU4Bcjs.safeDeepCopy,
61
73
  setObjValue: () => _chunkE4WBX6J5cjs.setObjValue,
62
74
  setSort: () => _chunkIIKQHLKTcjs.setSort,
75
+ simpleDeepCopy: () => _chunkSJ74DU4Bcjs.simpleDeepCopy,
76
+ structuredCloneCopy: () => _chunkSJ74DU4Bcjs.structuredCloneCopy,
63
77
  unmergeObject: () => _chunk3VYRYSWKcjs.unmergeObject
64
78
  });
65
79
 
@@ -2,6 +2,9 @@ import {
2
2
  format,
3
3
  parseDateString
4
4
  } from "./chunk-EKY7GXCD.js";
5
+ import {
6
+ getEndOfDay
7
+ } from "./chunk-Q2EFMBMD.js";
5
8
  import {
6
9
  hourFormat
7
10
  } from "./chunk-UCF3YRN2.js";
@@ -13,6 +16,7 @@ import {
13
16
  var date_exports = {};
14
17
  __export(date_exports, {
15
18
  format: () => format,
19
+ getEndOfDay: () => getEndOfDay,
16
20
  hourFormat: () => hourFormat,
17
21
  parseDateString: () => parseDateString
18
22
  });
@@ -1,12 +1,12 @@
1
- import {
2
- string_exports
3
- } from "./chunk-F7MR5E6C.js";
4
1
  import {
5
2
  object_exports
6
- } from "./chunk-FKO3U4EX.js";
3
+ } from "./chunk-6BFEQDEL.js";
4
+ import {
5
+ string_exports
6
+ } from "./chunk-7EHG5A4B.js";
7
7
  import {
8
8
  array_exports
9
- } from "./chunk-HAXXG6HP.js";
9
+ } from "./chunk-PVXQ2H5H.js";
10
10
  import {
11
11
  __export
12
12
  } from "./chunk-MLKGABMK.js";
@@ -0,0 +1,10 @@
1
+ // packages/date/getEndOfDay.ts
2
+ function getEndOfDay(date = /* @__PURE__ */ new Date()) {
3
+ const endOfDay = new Date(date);
4
+ endOfDay.setHours(23, 59, 59, 999);
5
+ return endOfDay;
6
+ }
7
+
8
+ export {
9
+ getEndOfDay
10
+ };
@@ -0,0 +1,275 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/basic/object/deepCopys.ts
2
+ function deepCopys(obj, options = {}) {
3
+ const {
4
+ visited = /* @__PURE__ */ new WeakMap(),
5
+ maxDepth = 100,
6
+ handleProxy = "unwrap",
7
+ currentDepth = 0
8
+ } = options;
9
+ if (currentDepth >= maxDepth) {
10
+ console.warn("deepCopys: Maximum depth reached, returning reference");
11
+ return obj;
12
+ }
13
+ if (obj === null || obj === void 0 || typeof obj !== "object") {
14
+ return obj;
15
+ }
16
+ if (typeof obj === "function") {
17
+ return obj;
18
+ }
19
+ if (visited.has(obj)) {
20
+ return visited.get(obj);
21
+ }
22
+ const isProxy = isProxyObject(obj);
23
+ if (isProxy) {
24
+ switch (handleProxy) {
25
+ case "unwrap":
26
+ const rawValue = getProxyTarget(obj);
27
+ if (rawValue !== obj) {
28
+ return deepCopys(rawValue, {
29
+ visited,
30
+ maxDepth,
31
+ handleProxy,
32
+ currentDepth: currentDepth + 1
33
+ });
34
+ }
35
+ break;
36
+ case "clone":
37
+ const target = getProxyTarget(obj);
38
+ if (target !== obj) {
39
+ const result = deepCopys(target, {
40
+ visited,
41
+ maxDepth,
42
+ handleProxy,
43
+ currentDepth: currentDepth + 1
44
+ });
45
+ visited.set(obj, result);
46
+ return result;
47
+ }
48
+ break;
49
+ case "keep":
50
+ return obj;
51
+ }
52
+ }
53
+ if (obj instanceof Date) {
54
+ const copy = new Date(obj.getTime());
55
+ visited.set(obj, copy);
56
+ return copy;
57
+ }
58
+ if (obj instanceof RegExp) {
59
+ const copy = new RegExp(obj.source, obj.flags);
60
+ visited.set(obj, copy);
61
+ return copy;
62
+ }
63
+ if (obj instanceof Map) {
64
+ const copy = /* @__PURE__ */ new Map();
65
+ visited.set(obj, copy);
66
+ obj.forEach((value, key) => {
67
+ copy.set(
68
+ deepCopys(key, {
69
+ visited,
70
+ maxDepth,
71
+ handleProxy,
72
+ currentDepth: currentDepth + 1
73
+ }),
74
+ deepCopys(value, {
75
+ visited,
76
+ maxDepth,
77
+ handleProxy,
78
+ currentDepth: currentDepth + 1
79
+ })
80
+ );
81
+ });
82
+ return copy;
83
+ }
84
+ if (obj instanceof Set) {
85
+ const copy = /* @__PURE__ */ new Set();
86
+ visited.set(obj, copy);
87
+ obj.forEach((value) => {
88
+ copy.add(
89
+ deepCopys(value, {
90
+ visited,
91
+ maxDepth,
92
+ handleProxy,
93
+ currentDepth: currentDepth + 1
94
+ })
95
+ );
96
+ });
97
+ return copy;
98
+ }
99
+ if (obj instanceof ArrayBuffer) {
100
+ const copy = obj.slice(0);
101
+ visited.set(obj, copy);
102
+ return copy;
103
+ }
104
+ if (ArrayBuffer.isView(obj)) {
105
+ const copy = obj.slice();
106
+ visited.set(obj, copy);
107
+ return copy;
108
+ }
109
+ if (isPromise(obj)) {
110
+ return obj;
111
+ }
112
+ const objClone = Array.isArray(obj) ? [] : {};
113
+ visited.set(obj, objClone);
114
+ const keys = getAllPropertyKeys(obj);
115
+ for (const key of keys) {
116
+ try {
117
+ const descriptor = Object.getOwnPropertyDescriptor(
118
+ obj,
119
+ key
120
+ );
121
+ if (descriptor && descriptor.get) {
122
+ continue;
123
+ }
124
+ const value = obj[key];
125
+ objClone[key] = deepCopys(value, {
126
+ visited,
127
+ maxDepth,
128
+ handleProxy,
129
+ currentDepth: currentDepth + 1
130
+ });
131
+ } catch (error) {
132
+ continue;
133
+ }
134
+ }
135
+ return objClone;
136
+ }
137
+ function isProxyObject(obj) {
138
+ if (!obj || typeof obj !== "object") return false;
139
+ try {
140
+ if (obj && obj.__v_isReactive || obj.__v_isReadonly) {
141
+ return true;
142
+ }
143
+ } catch (e2) {
144
+ }
145
+ try {
146
+ const str = Object.prototype.toString.call(obj);
147
+ if (str === "[object Proxy]") {
148
+ return true;
149
+ }
150
+ } catch (e3) {
151
+ }
152
+ return false;
153
+ }
154
+ function getProxyTarget(obj) {
155
+ if (!obj || typeof obj !== "object") return obj;
156
+ try {
157
+ const raw = obj.__v_raw;
158
+ if (raw !== void 0) {
159
+ return raw;
160
+ }
161
+ } catch (e4) {
162
+ }
163
+ return obj;
164
+ }
165
+ function isPromise(obj) {
166
+ return obj && typeof obj === "object" && typeof obj.then === "function";
167
+ }
168
+ function getAllPropertyKeys(obj) {
169
+ const keys = [];
170
+ const ownKeys = Reflect.ownKeys(obj);
171
+ keys.push(...ownKeys);
172
+ return keys;
173
+ }
174
+ function safeDeepCopy(obj) {
175
+ try {
176
+ const rawObj = getRawReactiveValue(obj);
177
+ if (rawObj !== obj) {
178
+ return deepCopys(rawObj, {
179
+ handleProxy: "unwrap",
180
+ maxDepth: 50
181
+ });
182
+ }
183
+ } catch (error) {
184
+ }
185
+ return deepCopys(obj, {
186
+ handleProxy: "unwrap",
187
+ maxDepth: 50
188
+ });
189
+ }
190
+ function getRawReactiveValue(obj) {
191
+ if (!obj || typeof obj !== "object") return obj;
192
+ try {
193
+ const raw = obj.__v_raw;
194
+ if (raw !== void 0) {
195
+ return raw;
196
+ }
197
+ } catch (e5) {
198
+ }
199
+ try {
200
+ if (obj.__ob__) {
201
+ const plainObj = { ...obj };
202
+ delete plainObj.__ob__;
203
+ return plainObj;
204
+ }
205
+ } catch (e6) {
206
+ }
207
+ return obj;
208
+ }
209
+ function fastDeepCopy(obj) {
210
+ if (obj === null || obj === void 0 || typeof obj !== "object") {
211
+ return obj;
212
+ }
213
+ if (obj instanceof Date) {
214
+ return new Date(obj.getTime());
215
+ }
216
+ if (obj instanceof RegExp) {
217
+ return new RegExp(obj.source, obj.flags);
218
+ }
219
+ try {
220
+ return JSON.parse(JSON.stringify(obj));
221
+ } catch (e) {
222
+ console.warn("fastDeepCopy failed, falling back to deepCopys", e);
223
+ return deepCopys(obj, {
224
+ handleProxy: "unwrap",
225
+ maxDepth: 100
226
+ });
227
+ }
228
+ }
229
+ function structuredCloneCopy(obj) {
230
+ if (typeof structuredClone === "function") {
231
+ try {
232
+ return structuredClone(obj);
233
+ } catch (e) {
234
+ console.warn(
235
+ "structuredClone failed, falling back to deepCopys",
236
+ e
237
+ );
238
+ return deepCopys(obj);
239
+ }
240
+ }
241
+ return deepCopys(obj);
242
+ }
243
+ function isPlainObject(obj) {
244
+ return obj !== null && typeof obj === "object" && obj.constructor === Object;
245
+ }
246
+ function simpleDeepCopy(obj) {
247
+ if (obj === null || obj === void 0 || typeof obj !== "object") {
248
+ return obj;
249
+ }
250
+ if (Array.isArray(obj)) {
251
+ return obj.map((item) => simpleDeepCopy(item));
252
+ }
253
+ if (obj instanceof Date) {
254
+ return new Date(obj.getTime());
255
+ }
256
+ if (obj instanceof RegExp) {
257
+ return new RegExp(obj.source, obj.flags);
258
+ }
259
+ const copy = {};
260
+ for (const key in obj) {
261
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
262
+ copy[key] = simpleDeepCopy(obj[key]);
263
+ }
264
+ }
265
+ return copy;
266
+ }
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+ exports.deepCopys = deepCopys; exports.safeDeepCopy = safeDeepCopy; exports.fastDeepCopy = fastDeepCopy; exports.structuredCloneCopy = structuredCloneCopy; exports.isPlainObject = isPlainObject; exports.simpleDeepCopy = simpleDeepCopy;
@@ -27,16 +27,16 @@ import {
27
27
  } from "./chunk-PLNZCEDI.js";
28
28
  import {
29
29
  matchs
30
- } from "./chunk-T2QKEABG.js";
30
+ } from "./chunk-33X65PQS.js";
31
+ import {
32
+ matchsWhole
33
+ } from "./chunk-IRGCP7KH.js";
31
34
  import {
32
35
  matchsEnd
33
36
  } from "./chunk-YNOFNHEK.js";
34
37
  import {
35
38
  matchsStart
36
39
  } from "./chunk-S6JRKYPY.js";
37
- import {
38
- matchsWhole
39
- } from "./chunk-IRGCP7KH.js";
40
40
  import {
41
41
  __export
42
42
  } from "./chunk-MLKGABMK.js";