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

View File

@@ -7,6 +7,8 @@ export * from './util.promise.js';
export * from './util.hash.js';
export * from './util.merge.js';
export * from './util.cache.js';
export * from './util.string.js';
import { stringUtils } from './util.string.js';
import sleep from './util.sleep.js';
import { http, download } from './util.request.js';
@@ -38,4 +40,5 @@ export const utils = {
dayjs,
domain: domainUtils,
options: optionsUtils,
string: stringUtils,
};

View File

@@ -0,0 +1,8 @@
export const stringUtils = {
maxLength(str?: string, length = 100) {
if (str) {
return str.length > length ? str.slice(0, length) + '...' : str;
}
return '';
},
};