@fangzhongya/utils 0.0.8-6 → 0.0.8-60
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/array/asyncMergeArray.cjs +2 -2
- package/dist/basic/array/asyncMergeArray.d.ts +6 -6
- package/dist/basic/array/asyncMergeArray.js +1 -1
- package/dist/basic/array/deleteArray.cjs +7 -0
- package/dist/basic/array/deleteArray.d.ts +6 -0
- package/dist/basic/array/deleteArray.js +7 -0
- package/dist/basic/array/duplicateRemoval.d.ts +6 -6
- package/dist/basic/array/index.cjs +8 -4
- package/dist/basic/array/index.d.ts +1 -0
- package/dist/basic/array/index.js +9 -5
- package/dist/basic/array/isArray.d.ts +5 -5
- package/dist/basic/array/replaceAfter.d.ts +7 -7
- package/dist/basic/array/toggleArray.d.ts +7 -7
- package/dist/basic/index.cjs +18 -9
- package/dist/basic/index.d.ts +16 -7
- package/dist/basic/index.js +17 -8
- package/dist/basic/object/attrValueSort.cjs +7 -0
- package/dist/basic/object/attrValueSort.d.ts +12 -0
- package/dist/basic/object/attrValueSort.js +7 -0
- package/dist/basic/object/deepCopy.cjs +7 -0
- package/dist/basic/object/deepCopy.d.ts +8 -0
- package/dist/basic/object/deepCopy.js +7 -0
- package/dist/basic/object/filterObject.cjs +7 -0
- package/dist/basic/object/filterObject.d.ts +14 -0
- package/dist/basic/object/filterObject.js +7 -0
- package/dist/basic/object/getSort.cjs +7 -0
- package/dist/basic/object/getSort.d.ts +10 -0
- package/dist/basic/object/getSort.js +7 -0
- package/dist/basic/object/hasOwn.cjs +7 -0
- package/dist/basic/object/hasOwn.d.ts +9 -0
- package/dist/basic/object/hasOwn.js +7 -0
- package/dist/basic/object/index.cjs +27 -3
- package/dist/basic/object/index.d.ts +6 -0
- package/dist/basic/object/index.js +27 -3
- package/dist/basic/object/isObject.d.ts +5 -5
- package/dist/basic/object/isObjectArray.d.ts +5 -5
- package/dist/basic/object/mergeObject.d.ts +8 -8
- package/dist/basic/object/setSort.cjs +7 -0
- package/dist/basic/object/setSort.d.ts +7 -0
- package/dist/basic/object/setSort.js +7 -0
- package/dist/basic/object/unmergeObject.d.ts +8 -8
- package/dist/basic/string/appearNum.d.ts +6 -6
- package/dist/basic/string/appearNumSeat.d.ts +7 -7
- package/dist/basic/string/firstLower.d.ts +5 -5
- package/dist/basic/string/firstUpper.d.ts +5 -5
- package/dist/basic/string/getStartSame.d.ts +6 -6
- package/dist/basic/string/getStartSames.d.ts +6 -6
- package/dist/basic/string/index.cjs +16 -4
- package/dist/basic/string/index.d.ts +2 -0
- package/dist/basic/string/index.js +17 -5
- package/dist/basic/string/splitUpper.d.ts +5 -5
- package/dist/basic/string/toFunction.cjs +9 -0
- package/dist/basic/string/toFunction.d.ts +11 -0
- package/dist/basic/string/toFunction.js +9 -0
- package/dist/basic/string/toJson.cjs +10 -0
- package/dist/basic/string/toJson.d.ts +7 -0
- package/dist/basic/string/toJson.js +10 -0
- package/dist/chunk-22KQAIES.cjs +44 -0
- package/dist/chunk-2OR4FUOA.cjs +47 -0
- package/dist/chunk-2QGQBPEX.js +15 -0
- package/dist/chunk-2TWAHAYB.js +20 -0
- package/dist/chunk-3CNQO7VA.js +73 -0
- package/dist/chunk-3IR2ABRO.js +8 -0
- package/dist/chunk-3LWFUVER.js +60 -0
- package/dist/chunk-4X7AFGTV.cjs +21 -0
- package/dist/{chunk-PB6FN2XC.cjs → chunk-5BJORXPX.cjs} +25 -1
- package/dist/chunk-6O6YWEOS.cjs +20 -0
- package/dist/chunk-6YI3CDEW.js +35 -0
- package/dist/chunk-7AIT4XSD.cjs +13 -0
- package/dist/chunk-7HIO5Z2A.js +44 -0
- package/dist/chunk-AFKJQ4QP.js +35 -0
- package/dist/chunk-BMUGXWAO.cjs +26 -0
- package/dist/chunk-BPJMBYDX.cjs +73 -0
- package/dist/{chunk-HQFPDOWY.js → chunk-CO347JUB.js} +26 -2
- package/dist/chunk-D2WYYC5Y.js +35 -0
- package/dist/chunk-D3SX7OUV.cjs +11 -0
- package/dist/chunk-EWXBN4VG.cjs +21 -0
- package/dist/{chunk-QTMFFVOO.cjs → chunk-FGQXKLTH.cjs} +8 -3
- package/dist/chunk-GFAUQTB2.cjs +33 -0
- package/dist/chunk-GIAO77MY.js +49 -0
- package/dist/chunk-GOUC2DFA.cjs +8 -0
- package/dist/{chunk-JE4B4G3M.js → chunk-HWOO7GVI.js} +3 -3
- package/dist/chunk-IIKQHLKT.cjs +60 -0
- package/dist/chunk-J2GSJKCY.cjs +20 -0
- package/dist/chunk-JYPJ5QJ5.cjs +35 -0
- package/dist/{chunk-JLEIVV37.cjs → chunk-KHGCW3A7.cjs} +7 -7
- package/dist/chunk-KQR7FXBF.js +20 -0
- package/dist/chunk-LEPZYF2N.cjs +49 -0
- package/dist/chunk-MGX7U2CG.cjs +20 -0
- package/dist/chunk-MQHLAQQA.js +21 -0
- package/dist/chunk-N3FZ4WUI.js +16 -0
- package/dist/chunk-NCSN3MC5.js +21 -0
- package/dist/{chunk-NKIDWRRS.cjs → chunk-NMA3RPU4.cjs} +7 -3
- package/dist/chunk-OJFV3426.js +17 -0
- package/dist/{chunk-V3FWFWP2.cjs → chunk-PCS4RBZZ.cjs} +15 -3
- package/dist/chunk-PTLVJ5OL.cjs +17 -0
- package/dist/{chunk-2W7EPKCY.js → chunk-PVYBDMBK.js} +5 -5
- package/dist/chunk-Q63V2U5G.js +47 -0
- package/dist/chunk-Q6FMBSK4.js +27 -0
- package/dist/{chunk-IQHASAHU.js → chunk-QJVB3JIZ.js} +8 -3
- package/dist/{chunk-AVO4AWYH.cjs → chunk-QZVMLHFW.cjs} +2 -2
- package/dist/chunk-S42NGJ5W.js +11 -0
- package/dist/{chunk-P2CYIUCC.js → chunk-SRPYR2RT.js} +16 -4
- package/dist/chunk-T3FAFGFD.cjs +35 -0
- package/dist/chunk-T4BAVDTH.js +31 -0
- package/dist/{chunk-VNVG4BJ4.cjs → chunk-TCMJPIRM.cjs} +16 -12
- package/dist/chunk-TE3XNGF4.cjs +16 -0
- package/dist/chunk-UFYLVZNU.cjs +31 -0
- package/dist/{chunk-O2RP4UZQ.cjs → chunk-UGFSIZ5P.cjs} +2 -23
- package/dist/chunk-UJS77V4S.cjs +24 -0
- package/dist/chunk-UPPSZFBE.cjs +121 -0
- package/dist/{chunk-NSG7ZMXT.js → chunk-V3AYCU2W.js} +4 -4
- package/dist/chunk-VBS6YE6H.js +121 -0
- package/dist/chunk-VOMPPHW6.js +26 -0
- package/dist/chunk-VY5VQ7WE.cjs +21 -0
- package/dist/chunk-WIYZQNGO.js +33 -0
- package/dist/chunk-WLBKU7NM.cjs +15 -0
- package/dist/chunk-WPW3M5AP.js +20 -0
- package/dist/{chunk-76ZUEOEJ.js → chunk-WW6SKIVB.js} +8 -4
- package/dist/{chunk-QKLVFB74.js → chunk-WX3JYE47.js} +2 -23
- package/dist/chunk-XUL6LPTN.js +21 -0
- package/dist/{chunk-HVDU25XB.js → chunk-Y5WYKSYG.js} +1 -1
- package/dist/chunk-ZEAT23CI.js +13 -0
- package/dist/chunk-ZJIRJ4YJ.cjs +35 -0
- package/dist/{chunk-L6DY4GCH.cjs → chunk-ZLCUSADU.cjs} +5 -5
- package/dist/css/fetchUnitValue.cjs +2 -2
- package/dist/css/fetchUnitValue.d.ts +7 -7
- package/dist/css/fetchUnitValue.js +1 -1
- package/dist/css/getAttrObj.cjs +7 -0
- package/dist/css/getAttrObj.d.ts +11 -0
- package/dist/css/getAttrObj.js +7 -0
- package/dist/css/getCss.d.ts +7 -1
- package/dist/css/getPositionRelative.cjs +8 -0
- package/dist/css/getPositionRelative.d.ts +7 -0
- package/dist/css/getPositionRelative.js +8 -0
- package/dist/css/getPrentClass.cjs +8 -0
- package/dist/css/getPrentClass.d.ts +7 -0
- package/dist/css/getPrentClass.js +8 -0
- package/dist/css/getPrentCorres.cjs +7 -0
- package/dist/css/getPrentCorres.d.ts +7 -0
- package/dist/css/getPrentCorres.js +7 -0
- package/dist/css/getSVG.cjs +8 -0
- package/dist/css/getSVG.d.ts +14 -0
- package/dist/css/getSVG.js +8 -0
- package/dist/css/index.cjs +25 -4
- package/dist/css/index.d.ts +5 -0
- package/dist/css/index.js +25 -4
- package/dist/css/setCss.cjs +3 -2
- package/dist/css/setCss.d.ts +9 -1
- package/dist/css/setCss.js +2 -1
- package/dist/dom/getLocus.cjs +7 -0
- package/dist/dom/getLocus.d.ts +14 -0
- package/dist/dom/getLocus.js +7 -0
- package/dist/dom/getShiftEvent.cjs +13 -0
- package/dist/dom/getShiftEvent.d.ts +25 -0
- package/dist/dom/getShiftEvent.js +13 -0
- package/dist/dom/index.cjs +18 -0
- package/dist/dom/index.d.ts +2 -0
- package/dist/dom/index.js +18 -0
- package/dist/html/analysisHtml.cjs +8 -0
- package/dist/html/analysisHtml.d.ts +13 -0
- package/dist/html/analysisHtml.js +8 -0
- package/dist/html/htmlEscape.cjs +7 -0
- package/dist/html/htmlEscape.d.ts +8 -0
- package/dist/html/htmlEscape.js +7 -0
- package/dist/html/index.cjs +13 -0
- package/dist/html/index.d.ts +2 -0
- package/dist/html/index.js +13 -0
- package/dist/{index-b16b81dc.d.ts → index-123cda08.d.ts} +3 -0
- package/dist/index-22ee0e10.d.ts +13 -0
- package/dist/{index-eef2a16c.d.ts → index-4d550d78.d.ts} +10 -0
- package/dist/index-5aea66bb.d.ts +21 -0
- package/dist/index-614c8bf9.d.ts +31 -0
- package/dist/index-ae0241ec.d.ts +13 -0
- package/dist/index-bc08cd32.d.ts +14 -0
- package/dist/index-ed8c0e9f.d.ts +37 -0
- package/dist/index.cjs +70 -39
- package/dist/index.d.ts +31 -9
- package/dist/index.js +70 -39
- 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.d.ts +7 -7
- package/dist/judge/matchs.js +2 -2
- package/dist/judge/matchsEnd.d.ts +6 -6
- package/dist/judge/matchsStart.d.ts +6 -6
- package/dist/judge/matchsWhole.d.ts +6 -6
- package/dist/load/getSynch.d.ts +5 -5
- package/dist/load/index.cjs +3 -3
- package/dist/load/index.js +4 -4
- package/dist/log/styleLog.d.ts +65 -65
- package/dist/name/getComponentNames.cjs +3 -3
- package/dist/name/getComponentNames.d.ts +5 -5
- package/dist/name/getComponentNames.js +2 -2
- package/dist/name/getNames.cjs +3 -3
- package/dist/name/getNames.d.ts +5 -5
- package/dist/name/getNames.js +2 -2
- package/dist/name/humpToLine.d.ts +5 -5
- package/dist/name/index.cjs +7 -7
- package/dist/name/index.js +6 -6
- package/dist/name/lineToLargeHump.d.ts +5 -5
- package/dist/name/lineToSmallHump.d.ts +5 -5
- package/dist/node/getPort.cjs +2 -2
- package/dist/node/getPort.d.ts +10 -7
- package/dist/node/getPort.js +1 -1
- package/dist/node/index.cjs +3 -3
- package/dist/node/index.js +2 -2
- package/dist/tree/getTreeObj.cjs +11 -0
- package/dist/tree/getTreeObj.d.ts +26 -0
- package/dist/tree/getTreeObj.js +11 -0
- package/dist/tree/index.cjs +12 -0
- package/dist/tree/index.d.ts +1 -0
- package/dist/tree/index.js +12 -0
- package/dist/urls/getImportUrl.d.ts +6 -6
- package/dist/urls/getImportUrlSuffix.d.ts +6 -6
- package/dist/urls/getNewFileName.d.ts +5 -5
- package/dist/urls/getReplaceImportUrl.d.ts +6 -6
- package/dist/urls/getReplaceUrl.d.ts +6 -6
- package/dist/urls/getSuffix.d.ts +5 -5
- package/dist/urls/getUrlCatalogue.d.ts +5 -5
- package/dist/urls/getUrlCatalogueLast.d.ts +5 -5
- package/dist/urls/getUrlCatalogueObj.d.ts +14 -14
- package/dist/urls/index.cjs +10 -10
- package/dist/urls/index.js +13 -13
- package/package.json +186 -72
- package/dist/chunk-36NQW7GX.cjs +0 -24
- package/dist/chunk-6WSP6FLZ.cjs +0 -8
- package/dist/chunk-7IXRH3MU.js +0 -8
- package/dist/chunk-7KXJO4NI.js +0 -24
- package/dist/chunk-DGOE2UXJ.cjs +0 -24
- package/dist/chunk-XQB2HUHZ.js +0 -23
- package/dist/index-82b62caf.d.ts +0 -16
- package/dist/index-b93e2bc6.d.ts +0 -13
- package/dist/index-fab49d44.d.ts +0 -19
- package/dist/{chunk-AW3EGUGB.cjs → chunk-AXAVKIR3.cjs} +2 -2
- package/dist/{chunk-BWNLZJJG.js → chunk-EJWFLQF3.js} +3 -3
- package/dist/{chunk-33X65PQS.js → chunk-FRGDQOX4.js} +3 -3
- package/dist/{chunk-PAJDTMC5.cjs → chunk-KRBTSMT2.cjs} +3 -3
- package/dist/{chunk-VIVEXAEC.cjs → chunk-LPDYEUMB.cjs} +9 -9
- package/dist/{chunk-X6SR256S.js → chunk-MYS6DR74.js} +12 -12
- package/dist/{chunk-3YUI42XN.cjs → chunk-NGQKVTCR.cjs} +3 -3
- package/dist/{chunk-5UV36ZIW.cjs → chunk-O6P3QI3B.cjs} +3 -3
- package/dist/{chunk-MXLYIZIX.js → chunk-VRRDYCUH.js} +3 -3
- package/dist/{chunk-PN4OFZGM.js → chunk-XCTPS2CO.js} +3 -3
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// packages/basic/string/toFunction.ts
|
|
2
|
+
function toFunction(str) {
|
|
3
|
+
const obj = getFunctionFormat(str);
|
|
4
|
+
if (obj && obj.body) {
|
|
5
|
+
const param = (obj.param || "").split(",").map((o) => o.trim()).filter((v) => v);
|
|
6
|
+
return new Function(...param, obj.body);
|
|
7
|
+
} else {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function getFunctionFormat(v) {
|
|
12
|
+
if (v) {
|
|
13
|
+
let st = v.toString();
|
|
14
|
+
st = st.trim();
|
|
15
|
+
let name = "([a-z|A-Z|_|$][a-z|A-Z|_|$|0-9]*)?";
|
|
16
|
+
let fun = "((function)?\\s*" + name + "\\s*)?";
|
|
17
|
+
let param = "(\\(([^\\(|\\)]*)\\)\\s*)?";
|
|
18
|
+
let body = "[\\s|\\n|\\r]*\\{((.|\n|\r)+?)\\}[\\s|\\n|\\r]*";
|
|
19
|
+
let reg = new RegExp("^" + fun + param + body + "$");
|
|
20
|
+
let vts = reg.exec(st);
|
|
21
|
+
if (vts && vts.length > 0) {
|
|
22
|
+
return {
|
|
23
|
+
name: vts[3],
|
|
24
|
+
param: vts[5],
|
|
25
|
+
body: vts[6]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
toFunction,
|
|
34
|
+
getFunctionFormat
|
|
35
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/basic/object/getSort.ts
|
|
2
|
+
function getSort(obj, sort) {
|
|
3
|
+
const robj = {};
|
|
4
|
+
const ks = Object.keys(obj).sort(sort);
|
|
5
|
+
ks.forEach((k) => {
|
|
6
|
+
robj[k] = obj[k];
|
|
7
|
+
});
|
|
8
|
+
return robj;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.getSort = getSort;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getSVG
|
|
3
|
+
} from "./chunk-WIYZQNGO.js";
|
|
4
|
+
import {
|
|
5
|
+
setCss
|
|
6
|
+
} from "./chunk-XUL6LPTN.js";
|
|
7
|
+
import {
|
|
8
|
+
fetchUnitValue
|
|
9
|
+
} from "./chunk-WX3JYE47.js";
|
|
10
|
+
import {
|
|
11
|
+
getAttrObj
|
|
12
|
+
} from "./chunk-N3FZ4WUI.js";
|
|
13
|
+
import {
|
|
14
|
+
getPositionRelative
|
|
15
|
+
} from "./chunk-MQHLAQQA.js";
|
|
16
|
+
import {
|
|
17
|
+
getCss
|
|
18
|
+
} from "./chunk-5RZYHE3X.js";
|
|
19
|
+
import {
|
|
20
|
+
getPrentClass
|
|
21
|
+
} from "./chunk-2QGQBPEX.js";
|
|
22
|
+
import {
|
|
23
|
+
getPrentCorres
|
|
24
|
+
} from "./chunk-OJFV3426.js";
|
|
25
|
+
import {
|
|
26
|
+
__export
|
|
27
|
+
} from "./chunk-UICA3PK6.js";
|
|
28
|
+
|
|
29
|
+
// packages/css/index.ts
|
|
30
|
+
var css_exports = {};
|
|
31
|
+
__export(css_exports, {
|
|
32
|
+
fetchUnitValue: () => fetchUnitValue,
|
|
33
|
+
getAttrObj: () => getAttrObj,
|
|
34
|
+
getCss: () => getCss,
|
|
35
|
+
getPositionRelative: () => getPositionRelative,
|
|
36
|
+
getPrentClass: () => getPrentClass,
|
|
37
|
+
getPrentCorres: () => getPrentCorres,
|
|
38
|
+
getSVG: () => getSVG,
|
|
39
|
+
setCss: () => setCss
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
css_exports
|
|
44
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
toFunction
|
|
3
|
+
} from "./chunk-6YI3CDEW.js";
|
|
4
|
+
|
|
5
|
+
// packages/basic/string/toJson.ts
|
|
6
|
+
function toJSONStringify(obj, jb) {
|
|
7
|
+
return JSON.stringify(
|
|
8
|
+
obj,
|
|
9
|
+
function(_k, v) {
|
|
10
|
+
if (typeof v === "function") {
|
|
11
|
+
return "+Fun|" + v.toString().trim();
|
|
12
|
+
} else {
|
|
13
|
+
return v;
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
jb
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function toJSONParse(str) {
|
|
20
|
+
return JSON.parse(str, function(_k, v) {
|
|
21
|
+
if (typeof v === "string") {
|
|
22
|
+
if (/^\+Fun\|(.|\n|\r)+?\}$/g.test(v)) {
|
|
23
|
+
return toFunction(v.replace(/^\+Fun\|/, "")) || v;
|
|
24
|
+
} else {
|
|
25
|
+
return v;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return v;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
toJSONStringify,
|
|
34
|
+
toJSONParse
|
|
35
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk2OR4FUOAcjs = require('./chunk-2OR4FUOA.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkUPPSZFBEcjs = require('./chunk-UPPSZFBE.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunk5AZGAKWRcjs = require('./chunk-5AZGAKWR.cjs');
|
|
13
|
+
|
|
14
|
+
// packages/dom/index.ts
|
|
15
|
+
var dom_exports = {};
|
|
16
|
+
_chunk5AZGAKWRcjs.__export.call(void 0, dom_exports, {
|
|
17
|
+
foundEvent: () => _chunkUPPSZFBEcjs.foundEvent,
|
|
18
|
+
foundEventCallback: () => _chunkUPPSZFBEcjs.foundEventCallback,
|
|
19
|
+
getLocus: () => _chunk2OR4FUOAcjs.getLocus,
|
|
20
|
+
pressEvent: () => _chunkUPPSZFBEcjs.pressEvent,
|
|
21
|
+
shiftEvent: () => _chunkUPPSZFBEcjs.shiftEvent
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
exports.dom_exports = dom_exports;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/tree/getTreeObj.ts
|
|
2
|
+
function getTreeObj(type, arr, param) {
|
|
3
|
+
if (type == 1) {
|
|
4
|
+
return treeToArray(arr, param);
|
|
5
|
+
} else {
|
|
6
|
+
return arrayToTree(arr, param);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
function getTreeChildren(arr, param, fid, objs) {
|
|
10
|
+
arr.forEach((v) => {
|
|
11
|
+
const obj = Object.assign({}, v);
|
|
12
|
+
obj[param.fid] = fid;
|
|
13
|
+
const id = obj[param.id];
|
|
14
|
+
objs[id] = obj;
|
|
15
|
+
const arr2 = obj[param.children];
|
|
16
|
+
if (arr2 && arr2.length > 0) {
|
|
17
|
+
getTreeChildren(arr2, param, id, objs);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function treeToArray(arr, param) {
|
|
22
|
+
const objs = {};
|
|
23
|
+
arr.forEach((v) => {
|
|
24
|
+
const obj = Object.assign({}, v);
|
|
25
|
+
const id = obj[param.id];
|
|
26
|
+
const arr2 = obj[param.children];
|
|
27
|
+
if (arr2 && arr2.length > 0) {
|
|
28
|
+
getTreeChildren(arr2, param, id, objs);
|
|
29
|
+
}
|
|
30
|
+
objs[id] = obj;
|
|
31
|
+
});
|
|
32
|
+
const array = Object.values(objs).map((o) => {
|
|
33
|
+
const v = Object.assign({}, o);
|
|
34
|
+
delete v[param.children];
|
|
35
|
+
return v;
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
tree: arr,
|
|
39
|
+
array,
|
|
40
|
+
obj: objs
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function arrayToTree(arr, param) {
|
|
44
|
+
const djs = [];
|
|
45
|
+
const objs = {};
|
|
46
|
+
arr.forEach((v) => {
|
|
47
|
+
const obj = Object.assign({}, v);
|
|
48
|
+
const id = obj[param.id];
|
|
49
|
+
const fid = obj[param.fid];
|
|
50
|
+
if (fid) {
|
|
51
|
+
objs[fid] = objs[fid] || {};
|
|
52
|
+
objs[fid][param.children] = objs[fid][param.children] || [];
|
|
53
|
+
objs[fid][param.children].push(obj);
|
|
54
|
+
} else {
|
|
55
|
+
djs.push(obj);
|
|
56
|
+
}
|
|
57
|
+
if (objs[id]) {
|
|
58
|
+
obj[param.children] = objs[id][param.children];
|
|
59
|
+
}
|
|
60
|
+
objs[id] = obj;
|
|
61
|
+
});
|
|
62
|
+
return {
|
|
63
|
+
tree: djs,
|
|
64
|
+
array: arr,
|
|
65
|
+
obj: objs
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
exports.getTreeObj = getTreeObj; exports.treeToArray = treeToArray; exports.arrayToTree = arrayToTree;
|
|
@@ -1,9 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-
|
|
2
|
+
setSort
|
|
3
|
+
} from "./chunk-3LWFUVER.js";
|
|
4
4
|
import {
|
|
5
5
|
unmergeObject
|
|
6
6
|
} from "./chunk-A6J46LQK.js";
|
|
7
|
+
import {
|
|
8
|
+
deepCopy
|
|
9
|
+
} from "./chunk-WPW3M5AP.js";
|
|
10
|
+
import {
|
|
11
|
+
filterObject
|
|
12
|
+
} from "./chunk-S42NGJ5W.js";
|
|
13
|
+
import {
|
|
14
|
+
getSort
|
|
15
|
+
} from "./chunk-ZEAT23CI.js";
|
|
16
|
+
import {
|
|
17
|
+
hasOwn
|
|
18
|
+
} from "./chunk-3IR2ABRO.js";
|
|
19
|
+
import {
|
|
20
|
+
mergeObject
|
|
21
|
+
} from "./chunk-RD4EP3M5.js";
|
|
22
|
+
import {
|
|
23
|
+
attrValueSort
|
|
24
|
+
} from "./chunk-T4BAVDTH.js";
|
|
7
25
|
import {
|
|
8
26
|
isObjectArray
|
|
9
27
|
} from "./chunk-GYE23WAN.js";
|
|
@@ -17,9 +35,15 @@ import {
|
|
|
17
35
|
// packages/basic/object/index.ts
|
|
18
36
|
var object_exports = {};
|
|
19
37
|
__export(object_exports, {
|
|
38
|
+
attrValueSort: () => attrValueSort,
|
|
39
|
+
deepCopy: () => deepCopy,
|
|
40
|
+
filterObject: () => filterObject,
|
|
41
|
+
getSort: () => getSort,
|
|
42
|
+
hasOwn: () => hasOwn,
|
|
20
43
|
isObject: () => isObject,
|
|
21
44
|
isObjectArray: () => isObjectArray,
|
|
22
45
|
mergeObject: () => mergeObject,
|
|
46
|
+
setSort: () => setSort,
|
|
23
47
|
unmergeObject: () => unmergeObject
|
|
24
48
|
});
|
|
25
49
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// packages/basic/array/deleteArray.ts
|
|
2
|
+
function deleteArray(arr, obj, key) {
|
|
3
|
+
let wz = -1;
|
|
4
|
+
for (let index = 0; index < arr.length; index++) {
|
|
5
|
+
const element = arr[index];
|
|
6
|
+
if (obj && typeof obj === "object") {
|
|
7
|
+
if (key) {
|
|
8
|
+
if (element[key] === obj[key]) {
|
|
9
|
+
wz = index;
|
|
10
|
+
break;
|
|
11
|
+
}
|
|
12
|
+
} else {
|
|
13
|
+
if (element === obj) {
|
|
14
|
+
wz = index;
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
} else {
|
|
19
|
+
if (element === obj) {
|
|
20
|
+
wz = index;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (wz != -1) {
|
|
26
|
+
arr.splice(wz, 1);
|
|
27
|
+
return true;
|
|
28
|
+
} else {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
deleteArray
|
|
35
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/basic/object/filterObject.ts
|
|
2
|
+
function filterObject(obj, arr) {
|
|
3
|
+
arr.forEach((key) => {
|
|
4
|
+
delete obj[key];
|
|
5
|
+
});
|
|
6
|
+
return obj;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.filterObject = filterObject;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/html/htmlEscape.ts
|
|
2
|
+
var zObj = {
|
|
3
|
+
"<": "<",
|
|
4
|
+
">": ">",
|
|
5
|
+
'"': """,
|
|
6
|
+
"'": "'",
|
|
7
|
+
" ": " "
|
|
8
|
+
};
|
|
9
|
+
function htmlEscape(str) {
|
|
10
|
+
str = str.replace(/&(?!\w+;)/g, "&");
|
|
11
|
+
return str.replace(/[<>&" ']/g, (c) => {
|
|
12
|
+
if (c) {
|
|
13
|
+
return zObj[c] || c;
|
|
14
|
+
}
|
|
15
|
+
return c;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
exports.htmlEscape = htmlEscape;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/node/getPort.ts
|
|
2
2
|
var _net = require('net');
|
|
3
|
-
function getPort(
|
|
4
|
-
let { port, host, isLocal } = obj;
|
|
3
|
+
function getPort(host, port = 5173, isLocal = true) {
|
|
5
4
|
return new Promise((resolve, reject) => {
|
|
6
5
|
isPortOccupied(port, host, isLocal).then((v) => {
|
|
7
6
|
resolve({ port: v, host });
|
|
@@ -40,10 +39,16 @@ function getPortNotOccupied(port, host, isLocal) {
|
|
|
40
39
|
});
|
|
41
40
|
});
|
|
42
41
|
}
|
|
42
|
+
var hosts = ["0.0.0.0"];
|
|
43
43
|
function isPortOccupied(port, host, isLocal) {
|
|
44
44
|
return new Promise((resolve, reject) => {
|
|
45
|
+
if (isLocal) {
|
|
46
|
+
if (!host || hosts.includes(host)) {
|
|
47
|
+
host = "localhost";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
45
50
|
const server = _net.createServer.call(void 0, ).listen({
|
|
46
|
-
host
|
|
51
|
+
host,
|
|
47
52
|
port,
|
|
48
53
|
exclusive: true
|
|
49
54
|
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkTE3XNGF4cjs = require('./chunk-TE3XNGF4.cjs');
|
|
4
|
+
|
|
5
|
+
// packages/css/getSVG.ts
|
|
6
|
+
function getSVG(str) {
|
|
7
|
+
const reg = /<svg([^>]*)>((.|\n|\r|\t)*)<\/svg>/g;
|
|
8
|
+
const rs = reg.exec(str);
|
|
9
|
+
if (rs && rs.length > 0) {
|
|
10
|
+
const css = rs[1];
|
|
11
|
+
const body = rs[2];
|
|
12
|
+
const attr = _chunkTE3XNGF4cjs.getAttrObj.call(void 0, css);
|
|
13
|
+
const b = attr["viewBox"] || "";
|
|
14
|
+
const bs = b.split(" ") || [];
|
|
15
|
+
const l = Number(bs[0]) || 0;
|
|
16
|
+
const t = Number(bs[1]) || 0;
|
|
17
|
+
const w = Number(bs[2] || attr["width"]) || 24;
|
|
18
|
+
const h = Number(bs[3] || attr["height"]) || 24;
|
|
19
|
+
return {
|
|
20
|
+
body,
|
|
21
|
+
viewBox: b,
|
|
22
|
+
left: l,
|
|
23
|
+
top: t,
|
|
24
|
+
width: w,
|
|
25
|
+
height: h
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
exports.getSVG = getSVG;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getAttrObj
|
|
3
|
+
} from "./chunk-N3FZ4WUI.js";
|
|
4
|
+
|
|
5
|
+
// packages/html/analysisHtml.ts
|
|
6
|
+
function analysisHtml(str) {
|
|
7
|
+
const arr = [];
|
|
8
|
+
getHtml(arr, str);
|
|
9
|
+
return arr;
|
|
10
|
+
}
|
|
11
|
+
function getHtml(arr, str) {
|
|
12
|
+
const reg = /(<\/([a-z|A-Z][^\s|>]*)>)|(<([a-z|A-Z][^\s>/]*)((\s*([^\s="'/|>]+)(=('([^']*)'|"([^"]*)"|([^\s/>]*)))?\s*)*)(>|\/>))/g;
|
|
13
|
+
const rs = reg.exec(str);
|
|
14
|
+
if (rs && rs.length > 0) {
|
|
15
|
+
if (rs.index != 0) {
|
|
16
|
+
arr.push(str.substring(0, rs.index));
|
|
17
|
+
}
|
|
18
|
+
str = str.substring(rs.index + rs[0].length);
|
|
19
|
+
const js = rs[2];
|
|
20
|
+
if (js) {
|
|
21
|
+
return str;
|
|
22
|
+
}
|
|
23
|
+
const obj = {
|
|
24
|
+
div: rs[4],
|
|
25
|
+
attr: rs[5] ? getAttrObj(rs[5]) : void 0,
|
|
26
|
+
value: []
|
|
27
|
+
};
|
|
28
|
+
if (rs[13] == "/>") {
|
|
29
|
+
arr.push(obj);
|
|
30
|
+
} else {
|
|
31
|
+
arr.push(obj);
|
|
32
|
+
if (str) {
|
|
33
|
+
str = getHtml(obj.value, str);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (str) {
|
|
37
|
+
return getHtml(arr, str);
|
|
38
|
+
} else {
|
|
39
|
+
return "";
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
arr.push(str);
|
|
43
|
+
return "";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export {
|
|
48
|
+
analysisHtml
|
|
49
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
string_exports
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-SRPYR2RT.js";
|
|
4
4
|
import {
|
|
5
5
|
object_exports
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CO347JUB.js";
|
|
7
7
|
import {
|
|
8
8
|
array_exports
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WW6SKIVB.js";
|
|
10
10
|
import {
|
|
11
11
|
__export
|
|
12
12
|
} from "./chunk-UICA3PK6.js";
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/basic/object/setSort.ts
|
|
2
|
+
function sortAttr(obj, sort, key) {
|
|
3
|
+
const vexports = obj[key] || {};
|
|
4
|
+
const ks = Object.keys(vexports).sort(sort);
|
|
5
|
+
const exports = {};
|
|
6
|
+
ks.forEach((k) => {
|
|
7
|
+
exports[k] = vexports[k];
|
|
8
|
+
});
|
|
9
|
+
obj[key] = exports;
|
|
10
|
+
}
|
|
11
|
+
function sortAttrs(obj, sort, key) {
|
|
12
|
+
if (key instanceof Array) {
|
|
13
|
+
key.forEach((k) => {
|
|
14
|
+
sortAttr(obj, sort, k);
|
|
15
|
+
});
|
|
16
|
+
} else {
|
|
17
|
+
sortAttr(obj, sort, key);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function getSubAttrs(arr, key) {
|
|
21
|
+
const objarr = [];
|
|
22
|
+
arr.forEach((obj) => {
|
|
23
|
+
Object.keys(obj).forEach((v) => {
|
|
24
|
+
const z = obj[v];
|
|
25
|
+
if (key) {
|
|
26
|
+
if (key instanceof Array && key.includes(v)) {
|
|
27
|
+
objarr.push(z);
|
|
28
|
+
} else if (key === v) {
|
|
29
|
+
objarr.push(z);
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
objarr.push(z);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
return objarr;
|
|
37
|
+
}
|
|
38
|
+
function sortSubAttr(arr, sort, key) {
|
|
39
|
+
arr.forEach((v) => {
|
|
40
|
+
sortAttrs(v, sort, key);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function setSort(obj, sort, ...arr) {
|
|
44
|
+
let objarr = [obj];
|
|
45
|
+
const leg = arr.length;
|
|
46
|
+
for (let index = 0; index < leg; index++) {
|
|
47
|
+
const element = arr[index];
|
|
48
|
+
if (index == leg - 1) {
|
|
49
|
+
if (element) {
|
|
50
|
+
sortSubAttr(objarr, sort, element);
|
|
51
|
+
}
|
|
52
|
+
} else {
|
|
53
|
+
objarr = getSubAttrs(objarr, element);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
exports.setSort = setSort;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/basic/object/deepCopy.ts
|
|
2
|
+
function deepCopy(obj) {
|
|
3
|
+
const objClone = Array.isArray(obj) ? [] : {};
|
|
4
|
+
if (obj && typeof obj === "object") {
|
|
5
|
+
for (let key in obj) {
|
|
6
|
+
if (obj.hasOwnProperty(key)) {
|
|
7
|
+
if (obj[key] && typeof obj[key] === "object") {
|
|
8
|
+
objClone[key] = deepCopy(obj[key]);
|
|
9
|
+
} else {
|
|
10
|
+
objClone[key] = obj[key];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return objClone;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
exports.deepCopy = deepCopy;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkZJIRJ4YJcjs = require('./chunk-ZJIRJ4YJ.cjs');
|
|
4
|
+
|
|
5
|
+
// packages/basic/string/toJson.ts
|
|
6
|
+
function toJSONStringify(obj, jb) {
|
|
7
|
+
return JSON.stringify(
|
|
8
|
+
obj,
|
|
9
|
+
function(_k, v) {
|
|
10
|
+
if (typeof v === "function") {
|
|
11
|
+
return "+Fun|" + v.toString().trim();
|
|
12
|
+
} else {
|
|
13
|
+
return v;
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
jb
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function toJSONParse(str) {
|
|
20
|
+
return JSON.parse(str, function(_k, v) {
|
|
21
|
+
if (typeof v === "string") {
|
|
22
|
+
if (/^\+Fun\|(.|\n|\r)+?\}$/g.test(v)) {
|
|
23
|
+
return _chunkZJIRJ4YJcjs.toFunction.call(void 0, v.replace(/^\+Fun\|/, "")) || v;
|
|
24
|
+
} else {
|
|
25
|
+
return v;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return v;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
exports.toJSONStringify = toJSONStringify; exports.toJSONParse = toJSONParse;
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkKRBTSMT2cjs = require('./chunk-KRBTSMT2.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunkLTVXRDTDcjs = require('./chunk-LTVXRDTD.cjs');
|
|
6
|
+
var _chunkO6P3QI3Bcjs = require('./chunk-O6P3QI3B.cjs');
|
|
10
7
|
|
|
11
8
|
|
|
12
9
|
var _chunkXHR36FJKcjs = require('./chunk-XHR36FJK.cjs');
|
|
@@ -15,13 +12,16 @@ var _chunkXHR36FJKcjs = require('./chunk-XHR36FJK.cjs');
|
|
|
15
12
|
var _chunkWI55O3IVcjs = require('./chunk-WI55O3IV.cjs');
|
|
16
13
|
|
|
17
14
|
|
|
15
|
+
var _chunkLTVXRDTDcjs = require('./chunk-LTVXRDTD.cjs');
|
|
16
|
+
|
|
17
|
+
|
|
18
18
|
var _chunk5AZGAKWRcjs = require('./chunk-5AZGAKWR.cjs');
|
|
19
19
|
|
|
20
20
|
// packages/name/index.ts
|
|
21
21
|
var name_exports = {};
|
|
22
22
|
_chunk5AZGAKWRcjs.__export.call(void 0, name_exports, {
|
|
23
|
-
getComponentNames: () =>
|
|
24
|
-
getNames: () =>
|
|
23
|
+
getComponentNames: () => _chunkKRBTSMT2cjs.getComponentNames,
|
|
24
|
+
getNames: () => _chunkO6P3QI3Bcjs.getNames,
|
|
25
25
|
humpToLine: () => _chunkLTVXRDTDcjs.humpToLine,
|
|
26
26
|
lineToLargeHump: () => _chunkWI55O3IVcjs.lineToLargeHump,
|
|
27
27
|
lineToSmallHump: () => _chunkXHR36FJKcjs.lineToSmallHump
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
analysisHtml
|
|
3
|
+
} from "./chunk-GIAO77MY.js";
|
|
4
|
+
import {
|
|
5
|
+
htmlEscape
|
|
6
|
+
} from "./chunk-NCSN3MC5.js";
|
|
7
|
+
import {
|
|
8
|
+
__export
|
|
9
|
+
} from "./chunk-UICA3PK6.js";
|
|
10
|
+
|
|
11
|
+
// packages/html/index.ts
|
|
12
|
+
var html_exports = {};
|
|
13
|
+
__export(html_exports, {
|
|
14
|
+
analysisHtml: () => analysisHtml,
|
|
15
|
+
htmlEscape: () => htmlEscape
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
html_exports
|
|
20
|
+
};
|