chore: ipv6支持

This commit is contained in:
xiaojunnuo
2024-11-13 22:42:11 +08:00
parent 70db327eda
commit a38ff69cbd
6 changed files with 64 additions and 26 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ import * as sites from "./util.site";
import * as storages from "./util.storage";
import commons from "./util.common";
import * as mitt from "./util.mitt";
import router from "/util.router";
import { routerUtils } from "./util.router";
import { treeUtils } from "./util.tree";
export const util = {
...envs,
@@ -11,6 +11,6 @@ export const util = {
...storages,
...commons,
...mitt,
...router,
router: routerUtils,
tree: treeUtils
};
@@ -33,5 +33,12 @@ export default {
async sleep(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
},
maxLength(str?: string, length = 100) {
if (str) {
return str.length > length ? str.slice(0, length) + "..." : str;
}
return "";
}
};