@fangzhongya/utils 0.0.63 → 0.0.66
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/dist/basic/index.cjs +7 -7
- package/dist/basic/index.js +6 -6
- package/dist/basic/object/deepCopy.cjs +2 -2
- package/dist/basic/object/deepCopy.d.cts +1 -3
- package/dist/basic/object/deepCopy.d.ts +1 -3
- package/dist/basic/object/deepCopy.js +1 -1
- package/dist/basic/object/index.cjs +3 -3
- package/dist/basic/object/index.js +2 -2
- package/dist/basic/string/index.cjs +3 -3
- package/dist/basic/string/index.js +2 -2
- package/dist/basic/string/toJsons.cjs +2 -2
- package/dist/basic/string/toJsons.d.cts +1 -0
- package/dist/basic/string/toJsons.d.ts +1 -0
- package/dist/basic/string/toJsons.js +1 -1
- package/dist/{chunk-KZCLX66D.cjs → chunk-64UDCNFR.cjs} +2 -2
- package/dist/{chunk-JLO73Y7O.js → chunk-6MSVNVC2.js} +2 -2
- package/dist/chunk-BRIQCC74.js +28 -0
- package/dist/{chunk-NL6Q47ZV.js → chunk-CGDNKEYI.js} +1 -1
- package/dist/{chunk-7M7ORCKS.js → chunk-KURDD4RK.js} +1 -1
- package/dist/{chunk-LHJNQXEL.cjs → chunk-THCKSUIJ.cjs} +4 -4
- package/dist/{chunk-SHT5THEZ.cjs → chunk-TKE7IK2M.cjs} +99 -11
- package/dist/{chunk-FL2HPQ66.cjs → chunk-UHKL2RG3.cjs} +5 -5
- package/dist/{chunk-L4JXPCBW.cjs → chunk-XLYPGPDB.cjs} +5 -5
- package/dist/{chunk-X44UO4CZ.js → chunk-YKNGDK4I.js} +4 -4
- package/dist/chunk-YTSFTRYZ.cjs +28 -0
- package/dist/{chunk-FIODV4DZ.js → chunk-ZADO6V3Z.js} +99 -11
- package/dist/css/index.cjs +13 -13
- package/dist/css/index.js +13 -13
- package/dist/html/index.cjs +1 -1
- package/dist/html/index.js +1 -1
- package/dist/index.cjs +48 -48
- package/dist/index.js +51 -51
- package/dist/judge/index.cjs +6 -6
- package/dist/judge/index.js +5 -5
- package/dist/judge/matchs.cjs +3 -3
- package/dist/judge/matchs.js +2 -2
- package/dist/tree/index.cjs +3 -3
- package/dist/tree/index.js +6 -6
- package/dist/urls/index.cjs +13 -13
- package/dist/urls/index.js +17 -17
- package/dist/window/index.cjs +4 -4
- package/dist/window/index.js +7 -7
- package/package.json +1 -1
- package/dist/chunk-PBQPPZ4V.cjs +0 -23
- package/dist/chunk-SD2RWG3L.js +0 -23
- package/dist/{chunk-4MF6LYYS.cjs → chunk-2IWTROKK.cjs} +11 -11
- package/dist/{chunk-MZLWYQQH.js → chunk-5WQXANBO.js} +6 -6
- package/dist/{chunk-72GMBSE6.cjs → chunk-E74ZD4NG.cjs} +3 -3
- package/dist/{chunk-7GCUYESU.cjs → chunk-FZI44Q55.cjs} +12 -12
- package/dist/{chunk-HWQYLP45.js → chunk-HPVRBKIG.js} +12 -12
- package/dist/{chunk-3DUFQKFF.js → chunk-HRBXT5L3.js} +16 -16
- package/dist/{chunk-QUIZWAFR.js → chunk-OVHYLUAS.js} +5 -5
- package/dist/{chunk-APRM3ELY.cjs → chunk-PV2N6PF2.cjs} +2 -2
- package/dist/{chunk-3YUI42XN.cjs → chunk-T22I7TJQ.cjs} +3 -3
- package/dist/{chunk-33X65PQS.js → chunk-T2QKEABG.js} +3 -3
package/dist/basic/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-THCKSUIJ.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkXLYPGPDBcjs = require('../chunk-XLYPGPDB.cjs');
|
|
5
5
|
require('../chunk-ZZKR5C3Y.cjs');
|
|
6
6
|
require('../chunk-K2XKKEE7.cjs');
|
|
7
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-TKE7IK2M.cjs');
|
|
8
8
|
require('../chunk-HLKHFBMF.cjs');
|
|
9
9
|
require('../chunk-HWHYHL6J.cjs');
|
|
10
10
|
require('../chunk-J7S3KBHL.cjs');
|
|
@@ -14,7 +14,7 @@ require('../chunk-XWCRGY54.cjs');
|
|
|
14
14
|
require('../chunk-4PUYFFPO.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var _chunk64UDCNFRcjs = require('../chunk-64UDCNFR.cjs');
|
|
18
18
|
require('../chunk-IIKQHLKT.cjs');
|
|
19
19
|
require('../chunk-3VYRYSWK.cjs');
|
|
20
20
|
require('../chunk-GOUC2DFA.cjs');
|
|
@@ -22,7 +22,7 @@ require('../chunk-NRJPCN4J.cjs');
|
|
|
22
22
|
require('../chunk-A5UJF6LP.cjs');
|
|
23
23
|
require('../chunk-SLXKYTEU.cjs');
|
|
24
24
|
require('../chunk-UFYLVZNU.cjs');
|
|
25
|
-
require('../chunk-
|
|
25
|
+
require('../chunk-YTSFTRYZ.cjs');
|
|
26
26
|
require('../chunk-SJ74DU4B.cjs');
|
|
27
27
|
require('../chunk-D3SX7OUV.cjs');
|
|
28
28
|
require('../chunk-7AIT4XSD.cjs');
|
|
@@ -39,8 +39,8 @@ require('../chunk-2H3KVSFA.cjs');
|
|
|
39
39
|
require('../chunk-ILJLXJ5O.cjs');
|
|
40
40
|
require('../chunk-OJBZ7UUC.cjs');
|
|
41
41
|
require('../chunk-JR6ZN6QD.cjs');
|
|
42
|
-
require('../chunk-PW7RP73J.cjs');
|
|
43
42
|
require('../chunk-XW3XIK3D.cjs');
|
|
43
|
+
require('../chunk-PW7RP73J.cjs');
|
|
44
44
|
require('../chunk-UEVMS6QD.cjs');
|
|
45
45
|
require('../chunk-OQL4GIEJ.cjs');
|
|
46
46
|
require('../chunk-WWAPPA4E.cjs');
|
|
@@ -52,4 +52,4 @@ require('../chunk-75ZPJI57.cjs');
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
exports.array = _chunk65O7KWP4cjs.array_exports; exports.object =
|
|
55
|
+
exports.array = _chunk65O7KWP4cjs.array_exports; exports.object = _chunk64UDCNFRcjs.object_exports; exports.string = _chunkXLYPGPDBcjs.string_exports;
|
package/dist/basic/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-6MSVNVC2.js";
|
|
2
2
|
import {
|
|
3
3
|
string_exports
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-CGDNKEYI.js";
|
|
5
5
|
import "../chunk-SE2X5XKO.js";
|
|
6
6
|
import "../chunk-TIZFQBWC.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-ZADO6V3Z.js";
|
|
8
8
|
import "../chunk-ADPTUJSF.js";
|
|
9
9
|
import "../chunk-N5Y3XGHX.js";
|
|
10
10
|
import "../chunk-7DTHADVK.js";
|
|
@@ -14,7 +14,7 @@ import "../chunk-FS4JPT23.js";
|
|
|
14
14
|
import "../chunk-YKSVLAAK.js";
|
|
15
15
|
import {
|
|
16
16
|
object_exports
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-KURDD4RK.js";
|
|
18
18
|
import "../chunk-3LWFUVER.js";
|
|
19
19
|
import "../chunk-A6J46LQK.js";
|
|
20
20
|
import "../chunk-3IR2ABRO.js";
|
|
@@ -22,7 +22,7 @@ import "../chunk-RD4EP3M5.js";
|
|
|
22
22
|
import "../chunk-SHNH5OEU.js";
|
|
23
23
|
import "../chunk-B3IGSYZT.js";
|
|
24
24
|
import "../chunk-T4BAVDTH.js";
|
|
25
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-BRIQCC74.js";
|
|
26
26
|
import "../chunk-YMKTU42G.js";
|
|
27
27
|
import "../chunk-S42NGJ5W.js";
|
|
28
28
|
import "../chunk-ZEAT23CI.js";
|
|
@@ -39,8 +39,8 @@ import "../chunk-USIMBBLW.js";
|
|
|
39
39
|
import "../chunk-P7AWHISY.js";
|
|
40
40
|
import "../chunk-LPMR5W6M.js";
|
|
41
41
|
import "../chunk-DMZP4RPN.js";
|
|
42
|
-
import "../chunk-A276ZDLP.js";
|
|
43
42
|
import "../chunk-O34QAOO7.js";
|
|
43
|
+
import "../chunk-A276ZDLP.js";
|
|
44
44
|
import "../chunk-4OBNLDTJ.js";
|
|
45
45
|
import "../chunk-EWJJKQIO.js";
|
|
46
46
|
import "../chunk-BEKTNBRJ.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkYTSFTRYZcjs = require('../../chunk-YTSFTRYZ.cjs');
|
|
4
4
|
require('../../chunk-75ZPJI57.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
exports.deepCopy =
|
|
7
|
+
exports.deepCopy = _chunkYTSFTRYZcjs.deepCopy;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-64UDCNFR.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
var _chunkIIKQHLKTcjs = require('../../chunk-IIKQHLKT.cjs');
|
|
@@ -23,7 +23,7 @@ var _chunkSLXKYTEUcjs = require('../../chunk-SLXKYTEU.cjs');
|
|
|
23
23
|
var _chunkUFYLVZNUcjs = require('../../chunk-UFYLVZNU.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkYTSFTRYZcjs = require('../../chunk-YTSFTRYZ.cjs');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
|
|
@@ -72,4 +72,4 @@ require('../../chunk-75ZPJI57.cjs');
|
|
|
72
72
|
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
exports.attrValueSort = _chunkUFYLVZNUcjs.attrValueSort; exports.deepCopy =
|
|
75
|
+
exports.attrValueSort = _chunkUFYLVZNUcjs.attrValueSort; exports.deepCopy = _chunkYTSFTRYZcjs.deepCopy; exports.deepCopys = _chunkSJ74DU4Bcjs.deepCopys; exports.fastDeepCopy = _chunkSJ74DU4Bcjs.fastDeepCopy; exports.filterObject = _chunkD3SX7OUVcjs.filterObject; exports.getObjValue = _chunkA5UJF6LPcjs.getObjValue; exports.getSort = _chunk7AIT4XSDcjs.getSort; exports.hasOwn = _chunkGOUC2DFAcjs.hasOwn; exports.isEqual = _chunkWWAPPA4Ecjs.isEqual; exports.isEqualEnhanced = _chunkWWAPPA4Ecjs.isEqualEnhanced; exports.isObject = _chunkMIC3W2VYcjs.isObject; exports.isObjectArray = _chunkA5LHXE5Xcjs.isObjectArray; exports.isPlainObject = _chunkSJ74DU4Bcjs.isPlainObject; exports.mergeObject = _chunkNRJPCN4Jcjs.mergeObject; exports.reverseObj = _chunkSLXKYTEUcjs.reverseObj; exports.safeDeepCopy = _chunkSJ74DU4Bcjs.safeDeepCopy; exports.setObjValue = _chunkA5UJF6LPcjs.setObjValue; exports.setSort = _chunkIIKQHLKTcjs.setSort; exports.simpleDeepCopy = _chunkSJ74DU4Bcjs.simpleDeepCopy; exports.structuredCloneCopy = _chunkSJ74DU4Bcjs.structuredCloneCopy; exports.unmergeObject = _chunk3VYRYSWKcjs.unmergeObject;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../chunk-
|
|
1
|
+
import "../../chunk-KURDD4RK.js";
|
|
2
2
|
import {
|
|
3
3
|
setSort
|
|
4
4
|
} from "../../chunk-3LWFUVER.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "../../chunk-T4BAVDTH.js";
|
|
24
24
|
import {
|
|
25
25
|
deepCopy
|
|
26
|
-
} from "../../chunk-
|
|
26
|
+
} from "../../chunk-BRIQCC74.js";
|
|
27
27
|
import {
|
|
28
28
|
deepCopys,
|
|
29
29
|
fastDeepCopy,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../../chunk-XLYPGPDB.cjs');
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ var _chunkK2XKKEE7cjs = require('../../chunk-K2XKKEE7.cjs');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkTKE7IK2Mcjs = require('../../chunk-TKE7IK2M.cjs');
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
var _chunkHLKHFBMFcjs = require('../../chunk-HLKHFBMF.cjs');
|
|
@@ -88,4 +88,4 @@ require('../../chunk-75ZPJI57.cjs');
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
|
|
91
|
-
exports.appearNum = _chunkOJBZ7UUCcjs.appearNum; exports.appearNumSeat = _chunkJR6ZN6QDcjs.appearNumSeat; exports.deComment = _chunkXWCRGY54cjs.deComment; exports.extractParams = _chunkJJ37YIPJcjs.extractParams; exports.firstLower = _chunkUEVMS6QDcjs.firstLower; exports.firstUpper = _chunkOQL4GIEJcjs.firstUpper; exports.getContent = _chunk4PUYFFPOcjs.getContent; exports.getContents = _chunk4PUYFFPOcjs.getContents; exports.getFunctionFormat = _chunkJJ37YIPJcjs.getFunctionFormat; exports.getImports = _chunkHWHYHL6Jcjs.getImports; exports.getImportss = _chunkHWHYHL6Jcjs.getImportss; exports.getStartSame = _chunkJ7S3KBHLcjs.getStartSame; exports.getStartSames = _chunkPW7RP73Jcjs.getStartSames; exports.getStrNunPosit = _chunk2H3KVSFAcjs.getStrNunPosit; exports.serializeCodeBlock =
|
|
91
|
+
exports.appearNum = _chunkOJBZ7UUCcjs.appearNum; exports.appearNumSeat = _chunkJR6ZN6QDcjs.appearNumSeat; exports.deComment = _chunkXWCRGY54cjs.deComment; exports.extractParams = _chunkJJ37YIPJcjs.extractParams; exports.firstLower = _chunkUEVMS6QDcjs.firstLower; exports.firstUpper = _chunkOQL4GIEJcjs.firstUpper; exports.getContent = _chunk4PUYFFPOcjs.getContent; exports.getContents = _chunk4PUYFFPOcjs.getContents; exports.getFunctionFormat = _chunkJJ37YIPJcjs.getFunctionFormat; exports.getImports = _chunkHWHYHL6Jcjs.getImports; exports.getImportss = _chunkHWHYHL6Jcjs.getImportss; exports.getStartSame = _chunkJ7S3KBHLcjs.getStartSame; exports.getStartSames = _chunkPW7RP73Jcjs.getStartSames; exports.getStrNunPosit = _chunk2H3KVSFAcjs.getStrNunPosit; exports.serializeCodeBlock = _chunkTKE7IK2Mcjs.serializeCodeBlock; exports.serializeFunctionRef = _chunkTKE7IK2Mcjs.serializeFunctionRef; exports.splitUpper = _chunkL7FSHU27cjs.splitUpper; exports.startsNum = _chunkILJLXJ5Ocjs.startsNum; exports.toFunction = _chunkJJ37YIPJcjs.toFunction; exports.toFunctionParam = _chunkZZKR5C3Ycjs.toFunctionParam; exports.toFunctionParamOptions = _chunkZZKR5C3Ycjs.toFunctionParamOptions; exports.toJSONParse = _chunkK2XKKEE7cjs.toJSONParse; exports.toJSONSParse = _chunkTKE7IK2Mcjs.toJSONSParse; exports.toJSONSStringify = _chunkTKE7IK2Mcjs.toJSONSStringify; exports.toJSONStringify = _chunkK2XKKEE7cjs.toJSONStringify; exports.toStringParse = _chunkHLKHFBMFcjs.toStringParse;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../chunk-
|
|
1
|
+
import "../../chunk-CGDNKEYI.js";
|
|
2
2
|
import {
|
|
3
3
|
toFunctionParam,
|
|
4
4
|
toFunctionParamOptions
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
serializeFunctionRef,
|
|
13
13
|
toJSONSParse,
|
|
14
14
|
toJSONSStringify
|
|
15
|
-
} from "../../chunk-
|
|
15
|
+
} from "../../chunk-ZADO6V3Z.js";
|
|
16
16
|
import {
|
|
17
17
|
toStringParse
|
|
18
18
|
} from "../../chunk-ADPTUJSF.js";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkTKE7IK2Mcjs = require('../../chunk-TKE7IK2M.cjs');
|
|
7
7
|
require('../../chunk-JJ37YIPJ.cjs');
|
|
8
8
|
require('../../chunk-A5UJF6LP.cjs');
|
|
9
9
|
require('../../chunk-75ZPJI57.cjs');
|
|
@@ -12,4 +12,4 @@ require('../../chunk-75ZPJI57.cjs');
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
exports.serializeCodeBlock =
|
|
15
|
+
exports.serializeCodeBlock = _chunkTKE7IK2Mcjs.serializeCodeBlock; exports.serializeFunctionRef = _chunkTKE7IK2Mcjs.serializeFunctionRef; exports.toJSONSParse = _chunkTKE7IK2Mcjs.toJSONSParse; exports.toJSONSStringify = _chunkTKE7IK2Mcjs.toJSONSStringify;
|
|
@@ -22,7 +22,7 @@ var _chunkSLXKYTEUcjs = require('./chunk-SLXKYTEU.cjs');
|
|
|
22
22
|
var _chunkUFYLVZNUcjs = require('./chunk-UFYLVZNU.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _chunkYTSFTRYZcjs = require('./chunk-YTSFTRYZ.cjs');
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
|
|
@@ -55,7 +55,7 @@ var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
|
|
|
55
55
|
var object_exports = {};
|
|
56
56
|
_chunk75ZPJI57cjs.__export.call(void 0, object_exports, {
|
|
57
57
|
attrValueSort: () => _chunkUFYLVZNUcjs.attrValueSort,
|
|
58
|
-
deepCopy: () =>
|
|
58
|
+
deepCopy: () => _chunkYTSFTRYZcjs.deepCopy,
|
|
59
59
|
deepCopys: () => _chunkSJ74DU4Bcjs.deepCopys,
|
|
60
60
|
fastDeepCopy: () => _chunkSJ74DU4Bcjs.fastDeepCopy,
|
|
61
61
|
filterObject: () => _chunkD3SX7OUVcjs.filterObject,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// packages/basic/object/deepCopy.ts
|
|
2
|
+
function deepCopy(obj, filter = () => true) {
|
|
3
|
+
if (obj === null || obj === void 0 || typeof obj !== "object") {
|
|
4
|
+
return obj;
|
|
5
|
+
}
|
|
6
|
+
if (obj instanceof Date) {
|
|
7
|
+
return new Date(obj.getTime());
|
|
8
|
+
}
|
|
9
|
+
if (obj instanceof RegExp) {
|
|
10
|
+
return new RegExp(obj.source, obj.flags);
|
|
11
|
+
}
|
|
12
|
+
if (Array.isArray(obj)) {
|
|
13
|
+
return obj.map((item) => deepCopy(item, filter));
|
|
14
|
+
}
|
|
15
|
+
const copy = {};
|
|
16
|
+
for (const key in obj) {
|
|
17
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
18
|
+
if (filter(key)) {
|
|
19
|
+
copy[key] = deepCopy(obj[key], filter);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return copy;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export {
|
|
27
|
+
deepCopy
|
|
28
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkXLYPGPDBcjs = require('./chunk-XLYPGPDB.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk64UDCNFRcjs = require('./chunk-64UDCNFR.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: () =>
|
|
19
|
-
string: () =>
|
|
18
|
+
object: () => _chunk64UDCNFRcjs.object_exports,
|
|
19
|
+
string: () => _chunkXLYPGPDBcjs.string_exports
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
|
|
@@ -7,6 +7,9 @@ var _chunkA5UJF6LPcjs = require('./chunk-A5UJF6LP.cjs');
|
|
|
7
7
|
|
|
8
8
|
// packages/basic/string/toJsons.ts
|
|
9
9
|
var TYPE_MARKERS = {
|
|
10
|
+
// 对象引用
|
|
11
|
+
CIRCULAR_REF: "_CR_",
|
|
12
|
+
// 新增:循环引用标记
|
|
10
13
|
FUNCTION_REF: "_FR_",
|
|
11
14
|
CODE_BLOCK: "_CB_",
|
|
12
15
|
/**内置对象*/
|
|
@@ -93,20 +96,102 @@ var arrayBufferUtils = {
|
|
|
93
96
|
return buffer;
|
|
94
97
|
}
|
|
95
98
|
};
|
|
99
|
+
function getObjectPath(obj, key, seen) {
|
|
100
|
+
if (obj === null || obj === void 0) {
|
|
101
|
+
return String(key);
|
|
102
|
+
}
|
|
103
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
104
|
+
return String(key);
|
|
105
|
+
}
|
|
106
|
+
const objPath = seen.get(obj);
|
|
107
|
+
if (objPath) {
|
|
108
|
+
return Array.isArray(obj) ? `${objPath}[${key}]` : `${objPath}.${key}`;
|
|
109
|
+
}
|
|
110
|
+
const path = `root${key}`;
|
|
111
|
+
if (typeof obj === "object" && obj !== null && !seen.has(obj)) {
|
|
112
|
+
seen.set(obj, path);
|
|
113
|
+
}
|
|
114
|
+
return path;
|
|
115
|
+
}
|
|
116
|
+
function getObjectPathValue(obj, key) {
|
|
117
|
+
if (key === "root") {
|
|
118
|
+
return obj;
|
|
119
|
+
}
|
|
120
|
+
let path = key;
|
|
121
|
+
if (path.startsWith("root")) {
|
|
122
|
+
path = path.slice(4);
|
|
123
|
+
}
|
|
124
|
+
if (!path) {
|
|
125
|
+
return obj;
|
|
126
|
+
}
|
|
127
|
+
const parts = [];
|
|
128
|
+
let current = "";
|
|
129
|
+
let inArray = false;
|
|
130
|
+
let bracketDepth = 0;
|
|
131
|
+
for (let i = 0; i < path.length; i++) {
|
|
132
|
+
const char = path[i];
|
|
133
|
+
if (char === "[") {
|
|
134
|
+
if (current) {
|
|
135
|
+
parts.push(current);
|
|
136
|
+
current = "";
|
|
137
|
+
}
|
|
138
|
+
inArray = true;
|
|
139
|
+
current += char;
|
|
140
|
+
bracketDepth++;
|
|
141
|
+
} else if (char === "]") {
|
|
142
|
+
current += char;
|
|
143
|
+
bracketDepth--;
|
|
144
|
+
if (bracketDepth === 0) {
|
|
145
|
+
const arrayIndex = current.slice(1, -1);
|
|
146
|
+
parts.push(arrayIndex);
|
|
147
|
+
current = "";
|
|
148
|
+
inArray = false;
|
|
149
|
+
}
|
|
150
|
+
} else if (char === "." && !inArray) {
|
|
151
|
+
if (current) {
|
|
152
|
+
parts.push(current);
|
|
153
|
+
current = "";
|
|
154
|
+
}
|
|
155
|
+
} else {
|
|
156
|
+
current += char;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (current) {
|
|
160
|
+
parts.push(current);
|
|
161
|
+
}
|
|
162
|
+
let result = obj;
|
|
163
|
+
for (const part of parts) {
|
|
164
|
+
if (result === null || result === void 0) {
|
|
165
|
+
return void 0;
|
|
166
|
+
}
|
|
167
|
+
const num = Number(part);
|
|
168
|
+
const index = !isNaN(num) && part.trim() !== "" ? num : part;
|
|
169
|
+
result = result[index];
|
|
170
|
+
}
|
|
171
|
+
return result;
|
|
172
|
+
}
|
|
96
173
|
function toJSONSStringify(obj, space, filtrat = "__") {
|
|
97
|
-
const seen = /* @__PURE__ */ new
|
|
174
|
+
const seen = /* @__PURE__ */ new WeakMap();
|
|
98
175
|
return JSON.stringify(
|
|
99
176
|
obj,
|
|
100
177
|
function(key, value) {
|
|
178
|
+
const fullPath = this === null || this === void 0 ? key : getObjectPath(this, key, seen);
|
|
101
179
|
if (filtrat && key.startsWith(filtrat)) {
|
|
102
180
|
return void 0;
|
|
103
181
|
}
|
|
104
182
|
if (value === null) {
|
|
105
183
|
return null;
|
|
106
184
|
}
|
|
107
|
-
if (typeof value === "object") {
|
|
108
|
-
|
|
109
|
-
|
|
185
|
+
if (typeof value === "object" && value !== null) {
|
|
186
|
+
const existingPath = seen.get(value);
|
|
187
|
+
if (existingPath && existingPath !== fullPath) {
|
|
188
|
+
return {
|
|
189
|
+
[TYPE_MARKERS.CIRCULAR_REF]: existingPath
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
if (!seen.has(value)) {
|
|
193
|
+
seen.set(value, fullPath);
|
|
194
|
+
}
|
|
110
195
|
}
|
|
111
196
|
if (this[key] instanceof Date) {
|
|
112
197
|
return {
|
|
@@ -280,7 +365,7 @@ function toJSONSParse(str, context) {
|
|
|
280
365
|
}
|
|
281
366
|
return value;
|
|
282
367
|
});
|
|
283
|
-
return restoreSpecialValues(parsed);
|
|
368
|
+
return restoreSpecialValues(parsed, parsed);
|
|
284
369
|
} catch (error) {
|
|
285
370
|
console.error("JSON parse error:", {
|
|
286
371
|
str: str.slice(0, 200) + "...",
|
|
@@ -289,36 +374,36 @@ function toJSONSParse(str, context) {
|
|
|
289
374
|
return {};
|
|
290
375
|
}
|
|
291
376
|
}
|
|
292
|
-
function restoreSpecialValues(obj, depth = 0) {
|
|
377
|
+
function restoreSpecialValues(original, obj, depth = 0) {
|
|
293
378
|
if (depth > 100) throw new Error("Recursion limit exceeded");
|
|
294
379
|
if (obj === null || typeof obj !== "object") {
|
|
295
380
|
return obj;
|
|
296
381
|
}
|
|
297
382
|
if (Array.isArray(obj)) {
|
|
298
383
|
return obj.map((item) => {
|
|
299
|
-
const converted = convertSpecialValue(item);
|
|
384
|
+
const converted = convertSpecialValue(original, item);
|
|
300
385
|
if (converted !== item) {
|
|
301
386
|
return converted;
|
|
302
387
|
}
|
|
303
|
-
return restoreSpecialValues(item, depth + 1);
|
|
388
|
+
return restoreSpecialValues(original, item, depth + 1);
|
|
304
389
|
});
|
|
305
390
|
}
|
|
306
391
|
const result = {};
|
|
307
392
|
for (const key in obj) {
|
|
308
393
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
309
394
|
let value = obj[key];
|
|
310
|
-
const converted = convertSpecialValue(value);
|
|
395
|
+
const converted = convertSpecialValue(original, value);
|
|
311
396
|
if (converted !== value) {
|
|
312
397
|
value = converted;
|
|
313
398
|
} else {
|
|
314
|
-
value = restoreSpecialValues(value, depth + 1);
|
|
399
|
+
value = restoreSpecialValues(original, value, depth + 1);
|
|
315
400
|
}
|
|
316
401
|
result[key] = value;
|
|
317
402
|
}
|
|
318
403
|
}
|
|
319
404
|
return result;
|
|
320
405
|
}
|
|
321
|
-
function convertSpecialValue(value) {
|
|
406
|
+
function convertSpecialValue(original, value) {
|
|
322
407
|
if (value && typeof value === "object") {
|
|
323
408
|
const keys = Object.keys(value);
|
|
324
409
|
if (keys.length === 1) {
|
|
@@ -397,6 +482,9 @@ function convertSpecialValue(value) {
|
|
|
397
482
|
const buffer = arrayBufferUtils.decode(markerValue.b);
|
|
398
483
|
return new DataView(buffer, markerValue.o, markerValue.l);
|
|
399
484
|
}
|
|
485
|
+
case TYPE_MARKERS.CIRCULAR_REF: {
|
|
486
|
+
return getObjectPathValue(original, markerValue);
|
|
487
|
+
}
|
|
400
488
|
}
|
|
401
489
|
}
|
|
402
490
|
}
|
|
@@ -27,10 +27,7 @@
|
|
|
27
27
|
var _chunkV2DXOH6Bcjs = require('./chunk-V2DXOH6B.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
var _chunk2BY5RQHUcjs = require('./chunk-2BY5RQHU.cjs');
|
|
30
|
+
var _chunkT22I7TJQcjs = require('./chunk-T22I7TJQ.cjs');
|
|
34
31
|
|
|
35
32
|
|
|
36
33
|
var _chunkYGJOBIEOcjs = require('./chunk-YGJOBIEO.cjs');
|
|
@@ -39,6 +36,9 @@ var _chunkYGJOBIEOcjs = require('./chunk-YGJOBIEO.cjs');
|
|
|
39
36
|
var _chunkZZEFL2TEcjs = require('./chunk-ZZEFL2TE.cjs');
|
|
40
37
|
|
|
41
38
|
|
|
39
|
+
var _chunk2BY5RQHUcjs = require('./chunk-2BY5RQHU.cjs');
|
|
40
|
+
|
|
41
|
+
|
|
42
42
|
var _chunk75ZPJI57cjs = require('./chunk-75ZPJI57.cjs');
|
|
43
43
|
|
|
44
44
|
// packages/judge/index.ts
|
|
@@ -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: () =>
|
|
72
|
+
matchs: () => _chunkT22I7TJQcjs.matchs,
|
|
73
73
|
matchsEnd: () => _chunkYGJOBIEOcjs.matchsEnd,
|
|
74
74
|
matchsStart: () => _chunkZZEFL2TEcjs.matchsStart,
|
|
75
75
|
matchsWhole: () => _chunk2BY5RQHUcjs.matchsWhole
|
|
@@ -11,7 +11,7 @@ var _chunkK2XKKEE7cjs = require('./chunk-K2XKKEE7.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _chunkTKE7IK2Mcjs = require('./chunk-TKE7IK2M.cjs');
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
var _chunkHLKHFBMFcjs = require('./chunk-HLKHFBMF.cjs');
|
|
@@ -79,16 +79,16 @@ _chunk75ZPJI57cjs.__export.call(void 0, string_exports, {
|
|
|
79
79
|
getStartSame: () => _chunkJ7S3KBHLcjs.getStartSame,
|
|
80
80
|
getStartSames: () => _chunkPW7RP73Jcjs.getStartSames,
|
|
81
81
|
getStrNunPosit: () => _chunk2H3KVSFAcjs.getStrNunPosit,
|
|
82
|
-
serializeCodeBlock: () =>
|
|
83
|
-
serializeFunctionRef: () =>
|
|
82
|
+
serializeCodeBlock: () => _chunkTKE7IK2Mcjs.serializeCodeBlock,
|
|
83
|
+
serializeFunctionRef: () => _chunkTKE7IK2Mcjs.serializeFunctionRef,
|
|
84
84
|
splitUpper: () => _chunkL7FSHU27cjs.splitUpper,
|
|
85
85
|
startsNum: () => _chunkILJLXJ5Ocjs.startsNum,
|
|
86
86
|
toFunction: () => _chunkJJ37YIPJcjs.toFunction,
|
|
87
87
|
toFunctionParam: () => _chunkZZKR5C3Ycjs.toFunctionParam,
|
|
88
88
|
toFunctionParamOptions: () => _chunkZZKR5C3Ycjs.toFunctionParamOptions,
|
|
89
89
|
toJSONParse: () => _chunkK2XKKEE7cjs.toJSONParse,
|
|
90
|
-
toJSONSParse: () =>
|
|
91
|
-
toJSONSStringify: () =>
|
|
90
|
+
toJSONSParse: () => _chunkTKE7IK2Mcjs.toJSONSParse,
|
|
91
|
+
toJSONSStringify: () => _chunkTKE7IK2Mcjs.toJSONSStringify,
|
|
92
92
|
toJSONStringify: () => _chunkK2XKKEE7cjs.toJSONStringify,
|
|
93
93
|
toStringParse: () => _chunkHLKHFBMFcjs.toStringParse
|
|
94
94
|
});
|
|
@@ -27,16 +27,16 @@ import {
|
|
|
27
27
|
} from "./chunk-PLNZCEDI.js";
|
|
28
28
|
import {
|
|
29
29
|
matchs
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import {
|
|
32
|
-
matchsWhole
|
|
33
|
-
} from "./chunk-IRGCP7KH.js";
|
|
30
|
+
} from "./chunk-T2QKEABG.js";
|
|
34
31
|
import {
|
|
35
32
|
matchsEnd
|
|
36
33
|
} from "./chunk-YNOFNHEK.js";
|
|
37
34
|
import {
|
|
38
35
|
matchsStart
|
|
39
36
|
} 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";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/basic/object/deepCopy.ts
|
|
2
|
+
function deepCopy(obj, filter = () => true) {
|
|
3
|
+
if (obj === null || obj === void 0 || typeof obj !== "object") {
|
|
4
|
+
return obj;
|
|
5
|
+
}
|
|
6
|
+
if (obj instanceof Date) {
|
|
7
|
+
return new Date(obj.getTime());
|
|
8
|
+
}
|
|
9
|
+
if (obj instanceof RegExp) {
|
|
10
|
+
return new RegExp(obj.source, obj.flags);
|
|
11
|
+
}
|
|
12
|
+
if (Array.isArray(obj)) {
|
|
13
|
+
return obj.map((item) => deepCopy(item, filter));
|
|
14
|
+
}
|
|
15
|
+
const copy = {};
|
|
16
|
+
for (const key in obj) {
|
|
17
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
18
|
+
if (filter(key)) {
|
|
19
|
+
copy[key] = deepCopy(obj[key], filter);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return copy;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
exports.deepCopy = deepCopy;
|