@fangzhongya/utils 0.0.50 → 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 (47) hide show
  1. package/dist/basic/index.cjs +22 -21
  2. package/dist/basic/index.d.cts +2 -1
  3. package/dist/basic/index.d.ts +2 -1
  4. package/dist/basic/index.js +21 -20
  5. package/dist/basic/object/deepCopys.cjs +17 -0
  6. package/dist/basic/object/deepCopys.d.cts +31 -0
  7. package/dist/basic/object/deepCopys.d.ts +31 -0
  8. package/dist/basic/object/deepCopys.js +17 -0
  9. package/dist/basic/object/index.cjs +24 -10
  10. package/dist/basic/object/index.d.cts +1 -0
  11. package/dist/basic/object/index.d.ts +1 -0
  12. package/dist/basic/object/index.js +30 -16
  13. package/dist/basic/string/index.cjs +11 -11
  14. package/dist/basic/string/index.js +13 -13
  15. package/dist/basic/string/toJsons.cjs +3 -3
  16. package/dist/basic/string/toJsons.js +2 -2
  17. package/dist/{chunk-XU7MQD33.js → chunk-6BFEQDEL.js} +29 -15
  18. package/dist/{chunk-LY3XJLNL.js → chunk-7EHG5A4B.js} +11 -11
  19. package/dist/{chunk-QC5UCHB5.cjs → chunk-7RFWR2DR.cjs} +12 -12
  20. package/dist/{chunk-J2WRN55J.cjs → chunk-FL2HPQ66.cjs} +6 -6
  21. package/dist/{chunk-53EIYZSN.cjs → chunk-G7BRLTGL.cjs} +4 -4
  22. package/dist/{chunk-UCDL7HLX.cjs → chunk-IODGCXUS.cjs} +22 -8
  23. package/dist/{chunk-Z4TJLQF2.js → chunk-MNS676PI.js} +4 -4
  24. package/dist/chunk-SJ74DU4B.cjs +275 -0
  25. package/dist/{chunk-7VGVDOZH.js → chunk-X44UO4CZ.js} +12 -12
  26. package/dist/chunk-YMKTU42G.js +275 -0
  27. package/dist/date/index.cjs +4 -4
  28. package/dist/date/index.js +4 -4
  29. package/dist/{index-BHI-3z9i.d.cts → index-Cz8fWd5l.d.cts} +8 -1
  30. package/dist/{index-C6fjPfzn.d.ts → index-J-xiEtN9.d.ts} +1 -1
  31. package/dist/{index-DYRjlOZp.d.cts → index-KftqgSWD.d.cts} +1 -1
  32. package/dist/{index-qKkaUBR7.d.ts → index-oW2flHUo.d.ts} +8 -1
  33. package/dist/index.cjs +44 -43
  34. package/dist/index.d.cts +3 -2
  35. package/dist/index.d.ts +3 -2
  36. package/dist/index.js +44 -43
  37. package/dist/judge/index.cjs +7 -7
  38. package/dist/judge/index.js +13 -13
  39. package/dist/judge/matchs.cjs +3 -3
  40. package/dist/judge/matchs.js +2 -2
  41. package/package.json +593 -588
  42. package/dist/{chunk-T2QKEABG.js → chunk-33X65PQS.js} +3 -3
  43. package/dist/{chunk-T22I7TJQ.cjs → chunk-3YUI42XN.cjs} +3 -3
  44. package/dist/{chunk-5SOPYS7L.cjs → chunk-7NEXCOZZ.cjs} +3 -3
  45. package/dist/{chunk-5HC662VK.js → chunk-I5D6RCLU.js} +3 -3
  46. package/dist/{chunk-H22VVRP6.js → chunk-JPQN3LUH.js} +3 -3
  47. package/dist/{chunk-ETMYYVQJ.cjs → chunk-L6JTKQ65.cjs} +2 -2
@@ -1,22 +1,16 @@
1
+ import {
2
+ toJSONParse,
3
+ toJSONStringify
4
+ } from "./chunk-U3PZBQ6G.js";
1
5
  import {
2
6
  serializeCodeBlock,
3
7
  serializeFunctionRef,
4
8
  toJSONSParse,
5
9
  toJSONSStringify
6
- } from "./chunk-5HC662VK.js";
10
+ } from "./chunk-I5D6RCLU.js";
7
11
  import {
8
12
  toStringParse
9
13
  } from "./chunk-MGK5PCGH.js";
10
- import {
11
- getStartSame
12
- } from "./chunk-7DTHADVK.js";
13
- import {
14
- splitUpper
15
- } from "./chunk-VKE5JARB.js";
16
- import {
17
- toJSONParse,
18
- toJSONStringify
19
- } from "./chunk-U3PZBQ6G.js";
20
14
  import {
21
15
  getFunctionFormat,
22
16
  toFunction
@@ -28,6 +22,12 @@ import {
28
22
  getImports,
29
23
  getImportss
30
24
  } from "./chunk-N5Y3XGHX.js";
25
+ import {
26
+ getStartSame
27
+ } from "./chunk-7DTHADVK.js";
28
+ import {
29
+ splitUpper
30
+ } from "./chunk-VKE5JARB.js";
31
31
  import {
32
32
  deComment
33
33
  } from "./chunk-FS4JPT23.js";
@@ -1,33 +1,33 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
+ var _chunkJHV27P2Qcjs = require('./chunk-JHV27P2Q.cjs');
4
5
 
5
6
 
6
- var _chunkETMYYVQJcjs = require('./chunk-ETMYYVQJ.cjs');
7
7
 
8
8
 
9
- var _chunkXG44HG5Ncjs = require('./chunk-XG44HG5N.cjs');
10
9
 
10
+ var _chunkL6JTKQ65cjs = require('./chunk-L6JTKQ65.cjs');
11
11
 
12
- var _chunkJ7S3KBHLcjs = require('./chunk-J7S3KBHL.cjs');
13
12
 
13
+ var _chunkXG44HG5Ncjs = require('./chunk-XG44HG5N.cjs');
14
14
 
15
- var _chunkL7FSHU27cjs = require('./chunk-L7FSHU27.cjs');
16
15
 
17
16
 
17
+ var _chunkQXK4IUBIcjs = require('./chunk-QXK4IUBI.cjs');
18
18
 
19
- var _chunkJHV27P2Qcjs = require('./chunk-JHV27P2Q.cjs');
20
19
 
20
+ var _chunkFQCXDJQ3cjs = require('./chunk-FQCXDJQ3.cjs');
21
21
 
22
22
 
23
- var _chunkQXK4IUBIcjs = require('./chunk-QXK4IUBI.cjs');
24
23
 
24
+ var _chunkHWHYHL6Jcjs = require('./chunk-HWHYHL6J.cjs');
25
25
 
26
- var _chunkFQCXDJQ3cjs = require('./chunk-FQCXDJQ3.cjs');
27
26
 
27
+ var _chunkJ7S3KBHLcjs = require('./chunk-J7S3KBHL.cjs');
28
28
 
29
29
 
30
- var _chunkHWHYHL6Jcjs = require('./chunk-HWHYHL6J.cjs');
30
+ var _chunkL7FSHU27cjs = require('./chunk-L7FSHU27.cjs');
31
31
 
32
32
 
33
33
  var _chunkXWCRGY54cjs = require('./chunk-XWCRGY54.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
  });
@@ -1,15 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkT22I7TJQcjs = require('./chunk-T22I7TJQ.cjs');
4
3
 
5
4
 
6
- var _chunkYGJOBIEOcjs = require('./chunk-YGJOBIEO.cjs');
7
5
 
8
6
 
9
- var _chunkZZEFL2TEcjs = require('./chunk-ZZEFL2TE.cjs');
10
7
 
11
8
 
12
- var _chunk2BY5RQHUcjs = require('./chunk-2BY5RQHU.cjs');
13
9
 
14
10
 
15
11
 
@@ -28,15 +24,19 @@ var _chunk2BY5RQHUcjs = require('./chunk-2BY5RQHU.cjs');
28
24
 
29
25
 
30
26
 
27
+ var _chunkV2DXOH6Bcjs = require('./chunk-V2DXOH6B.cjs');
31
28
 
32
29
 
30
+ var _chunk3YUI42XNcjs = require('./chunk-3YUI42XN.cjs');
33
31
 
34
32
 
33
+ var _chunk2BY5RQHUcjs = require('./chunk-2BY5RQHU.cjs');
35
34
 
36
35
 
36
+ var _chunkYGJOBIEOcjs = require('./chunk-YGJOBIEO.cjs');
37
37
 
38
38
 
39
- var _chunkV2DXOH6Bcjs = require('./chunk-V2DXOH6B.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
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkQC5UCHB5cjs = require('./chunk-QC5UCHB5.cjs');
3
+ var _chunkIODGCXUScjs = require('./chunk-IODGCXUS.cjs');
4
4
 
5
5
 
6
- var _chunkUCDL7HLXcjs = require('./chunk-UCDL7HLX.cjs');
6
+ var _chunk7RFWR2DRcjs = require('./chunk-7RFWR2DR.cjs');
7
7
 
8
8
 
9
9
  var _chunk65O7KWP4cjs = require('./chunk-65O7KWP4.cjs');
@@ -15,8 +15,8 @@ var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
15
15
  var basic_exports = {};
16
16
  _chunk75ZPJI57cjs.__export.call(void 0, basic_exports, {
17
17
  array: () => _chunk65O7KWP4cjs.array_exports,
18
- object: () => _chunkUCDL7HLXcjs.object_exports,
19
- string: () => _chunkQC5UCHB5cjs.string_exports
18
+ object: () => _chunkIODGCXUScjs.object_exports,
19
+ string: () => _chunk7RFWR2DRcjs.string_exports
20
20
  });
21
21
 
22
22
 
@@ -1,19 +1,21 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk3VYRYSWKcjs = require('./chunk-3VYRYSWK.cjs');
3
+ var _chunkSLXKYTEUcjs = require('./chunk-SLXKYTEU.cjs');
4
4
 
5
5
 
6
- var _chunkNRJPCN4Jcjs = require('./chunk-NRJPCN4J.cjs');
6
+ var _chunkIIKQHLKTcjs = require('./chunk-IIKQHLKT.cjs');
7
7
 
8
8
 
9
+ var _chunk3VYRYSWKcjs = require('./chunk-3VYRYSWK.cjs');
9
10
 
10
- var _chunkE4WBX6J5cjs = require('./chunk-E4WBX6J5.cjs');
11
11
 
12
+ var _chunk7AIT4XSDcjs = require('./chunk-7AIT4XSD.cjs');
12
13
 
13
- var _chunkSLXKYTEUcjs = require('./chunk-SLXKYTEU.cjs');
14
+
15
+ var _chunkGOUC2DFAcjs = require('./chunk-GOUC2DFA.cjs');
14
16
 
15
17
 
16
- var _chunkIIKQHLKTcjs = require('./chunk-IIKQHLKT.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
 
@@ -1,9 +1,9 @@
1
- import {
2
- string_exports
3
- } from "./chunk-LY3XJLNL.js";
4
1
  import {
5
2
  object_exports
6
- } from "./chunk-XU7MQD33.js";
3
+ } from "./chunk-6BFEQDEL.js";
4
+ import {
5
+ string_exports
6
+ } from "./chunk-7EHG5A4B.js";
7
7
  import {
8
8
  array_exports
9
9
  } from "./chunk-PVXQ2H5H.js";
@@ -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;
@@ -1,15 +1,3 @@
1
- import {
2
- matchs
3
- } from "./chunk-T2QKEABG.js";
4
- import {
5
- matchsEnd
6
- } from "./chunk-YNOFNHEK.js";
7
- import {
8
- matchsStart
9
- } from "./chunk-S6JRKYPY.js";
10
- import {
11
- matchsWhole
12
- } from "./chunk-IRGCP7KH.js";
13
1
  import {
14
2
  isAlphaNumeric,
15
3
  isBankCode,
@@ -37,6 +25,18 @@ import {
37
25
  isURL,
38
26
  isWeChat
39
27
  } from "./chunk-PLNZCEDI.js";
28
+ import {
29
+ matchs
30
+ } from "./chunk-33X65PQS.js";
31
+ import {
32
+ matchsWhole
33
+ } from "./chunk-IRGCP7KH.js";
34
+ import {
35
+ matchsEnd
36
+ } from "./chunk-YNOFNHEK.js";
37
+ import {
38
+ matchsStart
39
+ } from "./chunk-S6JRKYPY.js";
40
40
  import {
41
41
  __export
42
42
  } from "./chunk-MLKGABMK.js";