@fangzhongya/utils 0.0.8-1 → 0.0.8-11

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 (184) hide show
  1. package/dist/basic/array/asyncMergeArray.cjs +2 -2
  2. package/dist/basic/array/asyncMergeArray.d.ts +6 -6
  3. package/dist/basic/array/asyncMergeArray.js +1 -1
  4. package/dist/basic/array/duplicateRemoval.d.ts +6 -6
  5. package/dist/basic/array/index.cjs +7 -3
  6. package/dist/basic/array/index.d.ts +1 -0
  7. package/dist/basic/array/index.js +6 -2
  8. package/dist/basic/array/isArray.d.ts +5 -5
  9. package/dist/basic/array/replaceAfter.cjs +7 -0
  10. package/dist/basic/array/replaceAfter.d.ts +10 -0
  11. package/dist/basic/array/replaceAfter.js +7 -0
  12. package/dist/basic/array/toggleArray.d.ts +7 -7
  13. package/dist/basic/index.cjs +10 -6
  14. package/dist/basic/index.d.ts +13 -9
  15. package/dist/basic/index.js +9 -5
  16. package/dist/basic/object/attrValueSort.cjs +7 -0
  17. package/dist/basic/object/attrValueSort.d.ts +12 -0
  18. package/dist/basic/object/attrValueSort.js +7 -0
  19. package/dist/basic/object/filterObject.cjs +7 -0
  20. package/dist/basic/object/filterObject.d.ts +14 -0
  21. package/dist/basic/object/filterObject.js +7 -0
  22. package/dist/basic/object/index.cjs +10 -2
  23. package/dist/basic/object/index.d.ts +3 -1
  24. package/dist/basic/object/index.js +9 -1
  25. package/dist/basic/object/isObject.d.ts +5 -5
  26. package/dist/basic/object/isObjectArray.d.ts +5 -5
  27. package/dist/basic/object/mergeObject.d.ts +8 -8
  28. package/dist/basic/object/unmergeObject.d.ts +8 -8
  29. package/dist/basic/string/appearNum.d.ts +6 -6
  30. package/dist/basic/string/appearNumSeat.d.ts +7 -7
  31. package/dist/basic/string/firstLower.d.ts +5 -5
  32. package/dist/basic/string/firstUpper.d.ts +5 -5
  33. package/dist/basic/string/getStartSame.d.ts +6 -6
  34. package/dist/basic/string/getStartSames.d.ts +6 -6
  35. package/dist/basic/string/index.cjs +6 -2
  36. package/dist/basic/string/index.d.ts +3 -2
  37. package/dist/basic/string/index.js +6 -2
  38. package/dist/basic/string/splitUpper.cjs +7 -0
  39. package/dist/basic/string/splitUpper.d.ts +8 -0
  40. package/dist/basic/string/splitUpper.js +7 -0
  41. package/dist/chunk-2SJNYSOT.cjs +24 -0
  42. package/dist/chunk-2SOGI5PH.js +40 -0
  43. package/dist/{chunk-LHSOIOCS.cjs → chunk-36NQW7GX.cjs} +9 -1
  44. package/dist/chunk-43VE3KXL.cjs +27 -0
  45. package/dist/{chunk-YC2ZW3TX.cjs → chunk-4O7YOSS7.cjs} +6 -2
  46. package/dist/chunk-5RZYHE3X.js +16 -0
  47. package/dist/chunk-6WSP6FLZ.cjs +8 -0
  48. package/dist/{chunk-P3YVE7JK.cjs → chunk-77SI5VSS.cjs} +5 -2
  49. package/dist/chunk-7IXRH3MU.js +8 -0
  50. package/dist/{chunk-7LMEBJPQ.js → chunk-7KXJO4NI.js} +9 -1
  51. package/dist/{chunk-H2LFD53G.js → chunk-7OV6BXIR.js} +5 -1
  52. package/dist/{chunk-4LZUU2JU.cjs → chunk-AW3EGUGB.cjs} +4 -0
  53. package/dist/{chunk-DILKJQYV.cjs → chunk-CP2ZSRMU.cjs} +1 -1
  54. package/dist/chunk-D3SX7OUV.cjs +11 -0
  55. package/dist/{chunk-3BGPFW3U.cjs → chunk-DREUOE7L.cjs} +15 -7
  56. package/dist/{chunk-2W7EPKCY.js → chunk-DVA5F2QX.js} +5 -5
  57. package/dist/{chunk-HZLFOTLG.js → chunk-E75NHLNL.js} +5 -1
  58. package/dist/chunk-EWXBN4VG.cjs +21 -0
  59. package/dist/{chunk-QODMZOIX.js → chunk-F5D4AJXI.js} +15 -7
  60. package/dist/chunk-FGQXKLTH.cjs +67 -0
  61. package/dist/{chunk-ASN2EUM7.cjs → chunk-GH6ZVMB4.cjs} +5 -1
  62. package/dist/chunk-GOH6G74S.js +17 -0
  63. package/dist/chunk-HCEAYQHS.cjs +40 -0
  64. package/dist/{chunk-46Y4IUS6.js → chunk-JNDHSC43.js} +3 -3
  65. package/dist/chunk-L7FSHU27.cjs +23 -0
  66. package/dist/{chunk-PB6FN2XC.cjs → chunk-LFCIAOVE.cjs} +8 -0
  67. package/dist/chunk-LG7MY5KL.cjs +17 -0
  68. package/dist/chunk-NCSN3MC5.js +21 -0
  69. package/dist/{chunk-UH5FBLCV.js → chunk-PN4OFZGM.js} +4 -0
  70. package/dist/chunk-Q6FMBSK4.js +27 -0
  71. package/dist/chunk-QJVB3JIZ.js +67 -0
  72. package/dist/chunk-QZVMLHFW.cjs +16 -0
  73. package/dist/chunk-RFUD3TOQ.cjs +30 -0
  74. package/dist/chunk-S42NGJ5W.js +11 -0
  75. package/dist/{chunk-JLEIVV37.cjs → chunk-SQSYFDCI.cjs} +6 -6
  76. package/dist/{chunk-ZLCUSADU.cjs → chunk-SYXWQKOO.cjs} +5 -5
  77. package/dist/chunk-T4BAVDTH.js +31 -0
  78. package/dist/{chunk-VNVG4BJ4.cjs → chunk-TCMJPIRM.cjs} +16 -12
  79. package/dist/{chunk-AS3WKQP7.js → chunk-TP5BP64T.js} +5 -2
  80. package/dist/{chunk-HQFPDOWY.js → chunk-UEY4U2E2.js} +8 -0
  81. package/dist/chunk-UFYLVZNU.cjs +31 -0
  82. package/dist/chunk-UGS2F6DK.cjs +16 -0
  83. package/dist/chunk-VKE5JARB.js +23 -0
  84. package/dist/chunk-VYMN4FOM.cjs +16 -0
  85. package/dist/chunk-XAQM2IVP.js +16 -0
  86. package/dist/chunk-Y5WYKSYG.js +16 -0
  87. package/dist/{chunk-ZEXHP7HI.js → chunk-YWL2IWBT.js} +1 -1
  88. package/dist/chunk-YYWENXJO.js +27 -0
  89. package/dist/chunk-ZJHRAMCL.js +30 -0
  90. package/dist/{chunk-V3AYCU2W.js → chunk-ZQX2TYQB.js} +4 -4
  91. package/dist/css/fetchUnitValue.d.ts +7 -7
  92. package/dist/css/getCss.cjs +7 -0
  93. package/dist/css/getCss.d.ts +3 -0
  94. package/dist/css/getCss.js +7 -0
  95. package/dist/css/index.cjs +10 -2
  96. package/dist/css/index.d.ts +2 -0
  97. package/dist/css/index.js +10 -2
  98. package/dist/css/setCss.cjs +7 -0
  99. package/dist/css/setCss.d.ts +3 -0
  100. package/dist/css/setCss.js +7 -0
  101. package/dist/html/htmlEscape.cjs +7 -0
  102. package/dist/html/htmlEscape.d.ts +8 -0
  103. package/dist/html/htmlEscape.js +7 -0
  104. package/dist/html/index.cjs +8 -0
  105. package/dist/html/index.d.ts +1 -0
  106. package/dist/html/index.js +8 -0
  107. package/dist/{index-c07fa6d2.d.ts → index-0f061f5b.d.ts} +7 -1
  108. package/dist/index-130ae781.d.ts +10 -0
  109. package/dist/{index-a7638ef2.d.ts → index-42672b09.d.ts} +7 -1
  110. package/dist/{index-8b70f9ee.d.ts → index-82b62caf.d.ts} +6 -0
  111. package/dist/{index-136bb93b.d.ts → index-84b0c6c3.d.ts} +3 -0
  112. package/dist/index-98fa8a0f.d.ts +13 -0
  113. package/dist/{index-b61bcc84.d.ts → index-b16b81dc.d.ts} +3 -0
  114. package/dist/index-da501f98.d.ts +10 -0
  115. package/dist/{index-08b507f8.d.ts → index-f0bbf5f8.d.ts} +5 -2
  116. package/dist/index.cjs +48 -29
  117. package/dist/index.d.ts +35 -22
  118. package/dist/index.js +50 -31
  119. package/dist/judge/index.cjs +6 -6
  120. package/dist/judge/index.d.ts +1 -1
  121. package/dist/judge/index.js +5 -5
  122. package/dist/judge/matchs.cjs +3 -3
  123. package/dist/judge/matchs.d.ts +7 -7
  124. package/dist/judge/matchs.js +2 -2
  125. package/dist/judge/matchsEnd.d.ts +6 -6
  126. package/dist/judge/matchsStart.d.ts +6 -6
  127. package/dist/judge/matchsWhole.d.ts +6 -6
  128. package/dist/load/getSynch.cjs +7 -0
  129. package/dist/load/getSynch.d.ts +8 -0
  130. package/dist/load/getSynch.js +7 -0
  131. package/dist/load/index.cjs +6 -2
  132. package/dist/load/index.d.ts +1 -0
  133. package/dist/load/index.js +5 -1
  134. package/dist/log/styleLog.d.ts +65 -65
  135. package/dist/name/getComponentNames.cjs +3 -3
  136. package/dist/name/getComponentNames.d.ts +5 -5
  137. package/dist/name/getComponentNames.js +2 -2
  138. package/dist/name/getNames.cjs +3 -3
  139. package/dist/name/getNames.d.ts +5 -5
  140. package/dist/name/getNames.js +2 -2
  141. package/dist/name/humpToLine.d.ts +5 -5
  142. package/dist/name/index.cjs +6 -6
  143. package/dist/name/index.d.ts +1 -1
  144. package/dist/name/index.js +6 -6
  145. package/dist/name/lineToLargeHump.d.ts +5 -5
  146. package/dist/name/lineToSmallHump.d.ts +5 -5
  147. package/dist/node/getPort.cjs +7 -0
  148. package/dist/node/getPort.d.ts +13 -0
  149. package/dist/node/getPort.js +7 -0
  150. package/dist/node/index.cjs +8 -0
  151. package/dist/node/index.d.ts +1 -0
  152. package/dist/node/index.js +8 -0
  153. package/dist/urls/getImportUrl.d.ts +6 -6
  154. package/dist/urls/getImportUrlSuffix.d.ts +6 -6
  155. package/dist/urls/getNewFileName.cjs +8 -0
  156. package/dist/urls/getNewFileName.d.ts +8 -0
  157. package/dist/urls/getNewFileName.js +8 -0
  158. package/dist/urls/getReplaceImportUrl.cjs +8 -0
  159. package/dist/urls/getReplaceImportUrl.d.ts +9 -0
  160. package/dist/urls/getReplaceImportUrl.js +8 -0
  161. package/dist/urls/getReplaceUrl.d.ts +6 -6
  162. package/dist/urls/getSuffix.d.ts +5 -5
  163. package/dist/urls/getUrlCatalogue.cjs +2 -2
  164. package/dist/urls/getUrlCatalogue.d.ts +5 -5
  165. package/dist/urls/getUrlCatalogue.js +1 -1
  166. package/dist/urls/getUrlCatalogueLast.d.ts +5 -5
  167. package/dist/urls/getUrlCatalogueObj.cjs +2 -2
  168. package/dist/urls/getUrlCatalogueObj.d.ts +14 -13
  169. package/dist/urls/getUrlCatalogueObj.js +1 -1
  170. package/dist/urls/index.cjs +15 -7
  171. package/dist/urls/index.d.ts +3 -1
  172. package/dist/urls/index.js +16 -8
  173. package/package.json +152 -87
  174. package/dist/chunk-E344BLWD.cjs +0 -24
  175. package/dist/chunk-XQB2HUHZ.js +0 -23
  176. package/dist/index-6a62d537.d.ts +0 -13
  177. package/dist/{chunk-MXLYIZIX.js → chunk-4NHMMZ3Y.js} +3 -3
  178. package/dist/{chunk-PAJDTMC5.cjs → chunk-JQGFWHHR.cjs} +2 -2
  179. package/dist/{chunk-NGQKVTCR.cjs → chunk-T22I7TJQ.cjs} +3 -3
  180. package/dist/{chunk-FRGDQOX4.js → chunk-T2QKEABG.js} +3 -3
  181. package/dist/{chunk-BWNLZJJG.js → chunk-U3BGLZ6U.js} +3 -3
  182. package/dist/{chunk-5UV36ZIW.cjs → chunk-WMJORVL2.cjs} +2 -2
  183. package/dist/{index-110fd300.d.ts → index-a325ab56.d.ts} +1 -1
  184. package/dist/{index-48710eab.d.ts → index-a65f6120.d.ts} +1 -1
@@ -0,0 +1,21 @@
1
+ // packages/html/htmlEscape.ts
2
+ var zObj = {
3
+ "<": "&lt;",
4
+ ">": "&gt;",
5
+ '"': "&quot;",
6
+ "'": "&#039;",
7
+ " ": "&nbsp;"
8
+ };
9
+ function htmlEscape(str) {
10
+ str = str.replace(/&(?!\w+;)/g, "&amp;");
11
+ return str.replace(/[<>&" ']/g, (c) => {
12
+ if (c) {
13
+ return zObj[c] || c;
14
+ }
15
+ return c;
16
+ });
17
+ }
18
+
19
+ export {
20
+ htmlEscape
21
+ };
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  loadScript
3
3
  } from "./chunk-RU4PMJQS.js";
4
+ import {
5
+ getSynch
6
+ } from "./chunk-2SOGI5PH.js";
4
7
  import {
5
8
  __export
6
9
  } from "./chunk-UICA3PK6.js";
@@ -8,6 +11,7 @@ import {
8
11
  // packages/load/index.ts
9
12
  var load_exports = {};
10
13
  __export(load_exports, {
14
+ getSynch: () => getSynch,
11
15
  loadScript: () => loadScript
12
16
  });
13
17
 
@@ -0,0 +1,27 @@
1
+ // packages/basic/array/asyncMergeArray.ts
2
+ function asyncMergeArray(arr, callback) {
3
+ return new Promise((resolve, reject) => {
4
+ let index = 0;
5
+ const k = arr.length;
6
+ if (k > 0) {
7
+ arr.forEach((...a) => {
8
+ callback(
9
+ (...arr2) => {
10
+ index++;
11
+ if (k == index) {
12
+ resolve(arr2);
13
+ }
14
+ },
15
+ reject,
16
+ ...a
17
+ );
18
+ });
19
+ } else {
20
+ resolve(arr);
21
+ }
22
+ });
23
+ }
24
+
25
+ export {
26
+ asyncMergeArray
27
+ };
@@ -0,0 +1,67 @@
1
+ // packages/node/getPort.ts
2
+ import { createServer } from "node:net";
3
+ function getPort(host, port = 5173, isLocal = true) {
4
+ return new Promise((resolve, reject) => {
5
+ isPortOccupied(port, host, isLocal).then((v) => {
6
+ resolve({ port: v, host });
7
+ }).catch((e) => {
8
+ if (e.code === "EADDRINUSE") {
9
+ getPortNotOccupied(++port, host, isLocal).then((v) => {
10
+ resolve({
11
+ port: v,
12
+ host
13
+ });
14
+ }).catch(() => {
15
+ reject({
16
+ port,
17
+ host
18
+ });
19
+ });
20
+ } else {
21
+ reject({
22
+ port,
23
+ host
24
+ });
25
+ }
26
+ });
27
+ });
28
+ }
29
+ function getPortNotOccupied(port, host, isLocal) {
30
+ return new Promise((resolve, reject) => {
31
+ isPortOccupied(port, host, isLocal).then(() => {
32
+ resolve(port);
33
+ }).catch(async (e) => {
34
+ if (e.code === "EADDRINUSE") {
35
+ resolve(await getPortNotOccupied(++port, host, isLocal));
36
+ } else {
37
+ reject(e);
38
+ }
39
+ });
40
+ });
41
+ }
42
+ var hosts = ["0.0.0.0"];
43
+ function isPortOccupied(port, host, isLocal) {
44
+ return new Promise((resolve, reject) => {
45
+ if (isLocal) {
46
+ if (!host || hosts.includes(host)) {
47
+ host = "localhost";
48
+ }
49
+ }
50
+ const server = createServer().listen({
51
+ host,
52
+ port,
53
+ exclusive: true
54
+ });
55
+ server.on("listening", () => {
56
+ server.close();
57
+ resolve(port);
58
+ });
59
+ server.on("error", (e) => {
60
+ reject(e);
61
+ });
62
+ });
63
+ }
64
+
65
+ export {
66
+ getPort
67
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkFGQXKLTHcjs = require('./chunk-FGQXKLTH.cjs');
4
+
5
+
6
+ var _chunk5AZGAKWRcjs = require('./chunk-5AZGAKWR.cjs');
7
+
8
+ // packages/node/index.ts
9
+ var node_exports = {};
10
+ _chunk5AZGAKWRcjs.__export.call(void 0, node_exports, {
11
+ getPort: () => _chunkFGQXKLTHcjs.getPort
12
+ });
13
+
14
+
15
+
16
+ exports.node_exports = node_exports;
@@ -0,0 +1,30 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkPW7RP73Jcjs = require('./chunk-PW7RP73J.cjs');
4
+
5
+ // packages/urls/getReplaceImportUrl.ts
6
+ function getReplaceImportUrl(url, imp) {
7
+ const arr = _chunkPW7RP73Jcjs.getStartSames.call(void 0, url, imp);
8
+ const ts = arr[0];
9
+ if (!/[\\|\/]$/.test(ts)) {
10
+ const regs = ts.match(/[\\|\/]([^\\|\/]*)$/);
11
+ if (regs && regs.length > 0) {
12
+ const a = regs[1];
13
+ arr[0] = ts.substring(0, (regs.index || 0) + 1);
14
+ arr[1] = a + arr[1];
15
+ }
16
+ }
17
+ const l = arr[1].split(/\\|\//).length - 1;
18
+ let ds = ["./"];
19
+ if (l > 0) {
20
+ ds = [];
21
+ for (let index = 0; index < l; index++) {
22
+ ds.push("../");
23
+ }
24
+ }
25
+ return ds.join("");
26
+ }
27
+
28
+
29
+
30
+ exports.getReplaceImportUrl = getReplaceImportUrl;
@@ -0,0 +1,11 @@
1
+ // 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
+ export {
10
+ filterObject
11
+ };
@@ -1,15 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkPAJDTMC5cjs = require('./chunk-PAJDTMC5.cjs');
3
+ var _chunkJQGFWHHRcjs = require('./chunk-JQGFWHHR.cjs');
4
4
 
5
5
 
6
- var _chunk5UV36ZIWcjs = require('./chunk-5UV36ZIW.cjs');
6
+ var _chunkWMJORVL2cjs = require('./chunk-WMJORVL2.cjs');
7
7
 
8
8
 
9
- var _chunkLTVXRDTDcjs = require('./chunk-LTVXRDTD.cjs');
9
+ var _chunkXHR36FJKcjs = require('./chunk-XHR36FJK.cjs');
10
10
 
11
11
 
12
- var _chunkXHR36FJKcjs = require('./chunk-XHR36FJK.cjs');
12
+ var _chunkLTVXRDTDcjs = require('./chunk-LTVXRDTD.cjs');
13
13
 
14
14
 
15
15
  var _chunkWI55O3IVcjs = require('./chunk-WI55O3IV.cjs');
@@ -20,8 +20,8 @@ var _chunk5AZGAKWRcjs = require('./chunk-5AZGAKWR.cjs');
20
20
  // packages/name/index.ts
21
21
  var name_exports = {};
22
22
  _chunk5AZGAKWRcjs.__export.call(void 0, name_exports, {
23
- getComponentNames: () => _chunkPAJDTMC5cjs.getComponentNames,
24
- getNames: () => _chunk5UV36ZIWcjs.getNames,
23
+ getComponentNames: () => _chunkJQGFWHHRcjs.getComponentNames,
24
+ getNames: () => _chunkWMJORVL2cjs.getNames,
25
25
  humpToLine: () => _chunkLTVXRDTDcjs.humpToLine,
26
26
  lineToLargeHump: () => _chunkWI55O3IVcjs.lineToLargeHump,
27
27
  lineToSmallHump: () => _chunkXHR36FJKcjs.lineToSmallHump
@@ -1,15 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkNGQKVTCRcjs = require('./chunk-NGQKVTCR.cjs');
3
+ var _chunkT22I7TJQcjs = require('./chunk-T22I7TJQ.cjs');
4
4
 
5
5
 
6
- var _chunkZZEFL2TEcjs = require('./chunk-ZZEFL2TE.cjs');
6
+ var _chunkYGJOBIEOcjs = require('./chunk-YGJOBIEO.cjs');
7
7
 
8
8
 
9
- var _chunk2BY5RQHUcjs = require('./chunk-2BY5RQHU.cjs');
9
+ var _chunkZZEFL2TEcjs = require('./chunk-ZZEFL2TE.cjs');
10
10
 
11
11
 
12
- var _chunkYGJOBIEOcjs = require('./chunk-YGJOBIEO.cjs');
12
+ var _chunk2BY5RQHUcjs = require('./chunk-2BY5RQHU.cjs');
13
13
 
14
14
 
15
15
  var _chunk5AZGAKWRcjs = require('./chunk-5AZGAKWR.cjs');
@@ -17,7 +17,7 @@ var _chunk5AZGAKWRcjs = require('./chunk-5AZGAKWR.cjs');
17
17
  // packages/judge/index.ts
18
18
  var judge_exports = {};
19
19
  _chunk5AZGAKWRcjs.__export.call(void 0, judge_exports, {
20
- matchs: () => _chunkNGQKVTCRcjs.matchs,
20
+ matchs: () => _chunkT22I7TJQcjs.matchs,
21
21
  matchsEnd: () => _chunkYGJOBIEOcjs.matchsEnd,
22
22
  matchsStart: () => _chunkZZEFL2TEcjs.matchsStart,
23
23
  matchsWhole: () => _chunk2BY5RQHUcjs.matchsWhole
@@ -0,0 +1,31 @@
1
+ // packages/basic/object/attrValueSort.ts
2
+ function attrValueSort(obj, arr, sort) {
3
+ let arrsort;
4
+ if (arr && arr.length > 0) {
5
+ arrsort = arr.map((k) => {
6
+ return {
7
+ key: k,
8
+ value: obj[k]
9
+ };
10
+ });
11
+ } else {
12
+ arrsort = Object.keys(obj).map((k) => {
13
+ return {
14
+ key: k,
15
+ value: obj[k]
16
+ };
17
+ });
18
+ }
19
+ arrsort.sort((a, b) => {
20
+ if (sort) {
21
+ return sort(a.value, b.value);
22
+ } else {
23
+ return a.value - b.value;
24
+ }
25
+ });
26
+ return arrsort.map((o) => o.key);
27
+ }
28
+
29
+ export {
30
+ attrValueSort
31
+ };
@@ -3,18 +3,22 @@ function asyncMergeArray(arr, callback) {
3
3
  return new Promise((resolve, reject) => {
4
4
  let index = 0;
5
5
  const k = arr.length;
6
- arr.forEach((...a) => {
7
- callback(
8
- (...arr2) => {
9
- index++;
10
- if (k == index) {
11
- resolve(arr2);
12
- }
13
- },
14
- reject,
15
- ...a
16
- );
17
- });
6
+ if (k > 0) {
7
+ arr.forEach((...a) => {
8
+ callback(
9
+ (...arr2) => {
10
+ index++;
11
+ if (k == index) {
12
+ resolve(arr2);
13
+ }
14
+ },
15
+ reject,
16
+ ...a
17
+ );
18
+ });
19
+ } else {
20
+ resolve(arr);
21
+ }
18
22
  });
19
23
  }
20
24
 
@@ -1,18 +1,21 @@
1
1
  // packages/urls/getUrlCatalogueObj.ts
2
2
  function getUrlCatalogueObj(str) {
3
- const reg = /(\\|\/)([^\\|\/]+)(\.[a-z|A-Z]+)$/g;
3
+ const reg = /(\\|\/)([^\\|\/]+)\.([a-z|A-Z]+)$/g;
4
4
  const ml = str.replace(reg, "");
5
5
  let name = "";
6
6
  let suffix = "";
7
+ let apart = "";
7
8
  const arr = reg.exec(str);
8
9
  if (arr) {
10
+ apart = arr[1];
9
11
  name = arr[2];
10
12
  suffix = arr[3];
11
13
  }
12
14
  return {
13
15
  catalogue: ml,
14
16
  name,
15
- suffix
17
+ suffix,
18
+ apart
16
19
  };
17
20
  }
18
21
 
@@ -4,6 +4,12 @@ import {
4
4
  import {
5
5
  unmergeObject
6
6
  } from "./chunk-A6J46LQK.js";
7
+ import {
8
+ attrValueSort
9
+ } from "./chunk-T4BAVDTH.js";
10
+ import {
11
+ filterObject
12
+ } from "./chunk-S42NGJ5W.js";
7
13
  import {
8
14
  isObjectArray
9
15
  } from "./chunk-GYE23WAN.js";
@@ -17,6 +23,8 @@ import {
17
23
  // packages/basic/object/index.ts
18
24
  var object_exports = {};
19
25
  __export(object_exports, {
26
+ attrValueSort: () => attrValueSort,
27
+ filterObject: () => filterObject,
20
28
  isObject: () => isObject,
21
29
  isObjectArray: () => isObjectArray,
22
30
  mergeObject: () => mergeObject,
@@ -0,0 +1,31 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/basic/object/attrValueSort.ts
2
+ function attrValueSort(obj, arr, sort) {
3
+ let arrsort;
4
+ if (arr && arr.length > 0) {
5
+ arrsort = arr.map((k) => {
6
+ return {
7
+ key: k,
8
+ value: obj[k]
9
+ };
10
+ });
11
+ } else {
12
+ arrsort = Object.keys(obj).map((k) => {
13
+ return {
14
+ key: k,
15
+ value: obj[k]
16
+ };
17
+ });
18
+ }
19
+ arrsort.sort((a, b) => {
20
+ if (sort) {
21
+ return sort(a.value, b.value);
22
+ } else {
23
+ return a.value - b.value;
24
+ }
25
+ });
26
+ return arrsort.map((o) => o.key);
27
+ }
28
+
29
+
30
+
31
+ exports.attrValueSort = attrValueSort;
@@ -0,0 +1,16 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// packages/css/getCss.ts
2
+ function getStyles(elem) {
3
+ var view = elem.ownerDocument.defaultView;
4
+ if (!view || !view.opener) {
5
+ view = window;
6
+ }
7
+ return view.getComputedStyle(elem);
8
+ }
9
+ function getCss(elem, style) {
10
+ const styles = getStyles(elem);
11
+ return styles.getPropertyValue(style) || styles[style];
12
+ }
13
+
14
+
15
+
16
+ exports.getCss = getCss;
@@ -0,0 +1,23 @@
1
+ // packages/basic/string/splitUpper.ts
2
+ function splitUpper(name) {
3
+ const reg = /(([A-Z])([^A-Z]*))/g;
4
+ let result;
5
+ const arr = [];
6
+ let i = 0;
7
+ while ((result = reg.exec(name)) !== null) {
8
+ if (i == 0 && result.index != 0) {
9
+ arr.push(name.substring(0, result.index));
10
+ }
11
+ i++;
12
+ arr.push(result[1].toLowerCase());
13
+ }
14
+ if (arr.length > 0) {
15
+ return arr;
16
+ } else {
17
+ return [name];
18
+ }
19
+ }
20
+
21
+ export {
22
+ splitUpper
23
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkEWXBN4VGcjs = require('./chunk-EWXBN4VG.cjs');
4
+
5
+
6
+ var _chunk5AZGAKWRcjs = require('./chunk-5AZGAKWR.cjs');
7
+
8
+ // packages/html/index.ts
9
+ var html_exports = {};
10
+ _chunk5AZGAKWRcjs.__export.call(void 0, html_exports, {
11
+ htmlEscape: () => _chunkEWXBN4VGcjs.htmlEscape
12
+ });
13
+
14
+
15
+
16
+ exports.html_exports = html_exports;
@@ -0,0 +1,16 @@
1
+ import {
2
+ htmlEscape
3
+ } from "./chunk-NCSN3MC5.js";
4
+ import {
5
+ __export
6
+ } from "./chunk-UICA3PK6.js";
7
+
8
+ // packages/html/index.ts
9
+ var html_exports = {};
10
+ __export(html_exports, {
11
+ htmlEscape: () => htmlEscape
12
+ });
13
+
14
+ export {
15
+ html_exports
16
+ };
@@ -0,0 +1,16 @@
1
+ import {
2
+ getPort
3
+ } from "./chunk-QJVB3JIZ.js";
4
+ import {
5
+ __export
6
+ } from "./chunk-UICA3PK6.js";
7
+
8
+ // packages/node/index.ts
9
+ var node_exports = {};
10
+ __export(node_exports, {
11
+ getPort: () => getPort
12
+ });
13
+
14
+ export {
15
+ node_exports
16
+ };
@@ -1,6 +1,6 @@
1
1
  // packages/urls/getUrlCatalogue.ts
2
2
  function getUrlCatalogue(str) {
3
- const reg = /((\\|\/)([^\\|\/]+)(\.[a-z|A-Z]+))$/g;
3
+ const reg = /((\\|\/)([^\\|\/]+)(\.[a-z|A-Z]+))?$/g;
4
4
  return str.replace(reg, "");
5
5
  }
6
6
 
@@ -0,0 +1,27 @@
1
+ import {
2
+ getUrlCatalogueObj
3
+ } from "./chunk-TP5BP64T.js";
4
+
5
+ // packages/urls/getNewFileName.ts
6
+ function getNewFileName(url) {
7
+ const obj = getUrlCatalogueObj(url);
8
+ let wb = obj.name;
9
+ if (wb) {
10
+ const reg = /([0-9]+)$/g;
11
+ const regs = reg.exec(wb);
12
+ if (regs && regs.length > 0) {
13
+ const sl = Number(regs[1]) + 1;
14
+ const reg1 = new RegExp(regs[1] + "$");
15
+ wb = wb.replace(reg1, (sl + "").padStart(regs[1].length, "0"));
16
+ } else {
17
+ wb = wb + "1";
18
+ }
19
+ return obj.catalogue + obj.apart + wb + "." + obj.suffix;
20
+ } else {
21
+ return "";
22
+ }
23
+ }
24
+
25
+ export {
26
+ getNewFileName
27
+ };
@@ -0,0 +1,30 @@
1
+ import {
2
+ getStartSames
3
+ } from "./chunk-A276ZDLP.js";
4
+
5
+ // packages/urls/getReplaceImportUrl.ts
6
+ function getReplaceImportUrl(url, imp) {
7
+ const arr = getStartSames(url, imp);
8
+ const ts = arr[0];
9
+ if (!/[\\|\/]$/.test(ts)) {
10
+ const regs = ts.match(/[\\|\/]([^\\|\/]*)$/);
11
+ if (regs && regs.length > 0) {
12
+ const a = regs[1];
13
+ arr[0] = ts.substring(0, (regs.index || 0) + 1);
14
+ arr[1] = a + arr[1];
15
+ }
16
+ }
17
+ const l = arr[1].split(/\\|\//).length - 1;
18
+ let ds = ["./"];
19
+ if (l > 0) {
20
+ ds = [];
21
+ for (let index = 0; index < l; index++) {
22
+ ds.push("../");
23
+ }
24
+ }
25
+ return ds.join("");
26
+ }
27
+
28
+ export {
29
+ getReplaceImportUrl
30
+ };
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  matchs
3
- } from "./chunk-FRGDQOX4.js";
3
+ } from "./chunk-T2QKEABG.js";
4
+ import {
5
+ matchsEnd
6
+ } from "./chunk-YNOFNHEK.js";
4
7
  import {
5
8
  matchsStart
6
9
  } from "./chunk-S6JRKYPY.js";
7
10
  import {
8
11
  matchsWhole
9
12
  } from "./chunk-IRGCP7KH.js";
10
- import {
11
- matchsEnd
12
- } from "./chunk-YNOFNHEK.js";
13
13
  import {
14
14
  __export
15
15
  } from "./chunk-UICA3PK6.js";
@@ -1,10 +1,10 @@
1
- /**
2
- * 提取单位值
3
- * @param text
4
- * @param str
5
- * @param callback
6
- * @returns
7
- */
1
+ /**
2
+ * 提取单位值
3
+ * @param text
4
+ * @param str
5
+ * @param callback
6
+ * @returns
7
+ */
8
8
  declare function fetchUnitValue(text: string, str: string, callback?: (n: number, dw: string, yss: string, i: number) => string): string;
9
9
 
10
10
  export { fetchUnitValue };
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkUGS2F6DKcjs = require('../chunk-UGS2F6DK.cjs');
4
+ require('../chunk-5AZGAKWR.cjs');
5
+
6
+
7
+ exports.getCss = _chunkUGS2F6DKcjs.getCss;
@@ -0,0 +1,3 @@
1
+ declare function getCss(elem: HTMLDivElement, style: string): any;
2
+
3
+ export { getCss };
@@ -0,0 +1,7 @@
1
+ import {
2
+ getCss
3
+ } from "../chunk-5RZYHE3X.js";
4
+ import "../chunk-UICA3PK6.js";
5
+ export {
6
+ getCss
7
+ };
@@ -1,8 +1,16 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-LHSOIOCS.cjs');
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-36NQW7GX.cjs');
2
2
 
3
3
 
4
4
  var _chunkO2RP4UZQcjs = require('../chunk-O2RP4UZQ.cjs');
5
+
6
+
7
+ var _chunkUGS2F6DKcjs = require('../chunk-UGS2F6DK.cjs');
8
+
9
+
10
+ var _chunk6WSP6FLZcjs = require('../chunk-6WSP6FLZ.cjs');
5
11
  require('../chunk-5AZGAKWR.cjs');
6
12
 
7
13
 
8
- exports.fetchUnitValue = _chunkO2RP4UZQcjs.fetchUnitValue;
14
+
15
+
16
+ exports.fetchUnitValue = _chunkO2RP4UZQcjs.fetchUnitValue; exports.getCss = _chunkUGS2F6DKcjs.getCss; exports.setCss = _chunk6WSP6FLZcjs.setCss;
@@ -1 +1,3 @@
1
1
  export { fetchUnitValue } from './fetchUnitValue.js';
2
+ export { getCss } from './getCss.js';
3
+ export { setCss } from './setCss.js';
package/dist/css/index.js CHANGED
@@ -1,8 +1,16 @@
1
- import "../chunk-7LMEBJPQ.js";
1
+ import "../chunk-7KXJO4NI.js";
2
2
  import {
3
3
  fetchUnitValue
4
4
  } from "../chunk-QKLVFB74.js";
5
+ import {
6
+ getCss
7
+ } from "../chunk-5RZYHE3X.js";
8
+ import {
9
+ setCss
10
+ } from "../chunk-7IXRH3MU.js";
5
11
  import "../chunk-UICA3PK6.js";
6
12
  export {
7
- fetchUnitValue
13
+ fetchUnitValue,
14
+ getCss,
15
+ setCss
8
16
  };