选择厂商

这个提交包含在:
徐勤民 2024-10-19 15:12:22 +08:00
父节点 2081e3d6fa
当前提交 919151b0fa
共有 4 个文件被更改,包括 30 次插入1 次删除

查看文件

@ -1,4 +1,12 @@
# [v1.0.4] 2024.xx.xx
------
> - 优化缓存工具
> - 网络工具优化
> - 本次更新内容较多,请自行查看文档
>
# [v1.0.3] 2024.10.15
------

查看文件

@ -2,6 +2,7 @@
* 常用工具
*/
export { ToolsHelper } from './src/main/ets/utils/ToolsHelper'
export { ToolsHelperForTS } from './src/main/ets/utils/ToolsHelperForTS'
export { AlgorithmHelper } from './src/main/ets/utils/AlgorithmHelper'
/**

查看文件

@ -11,7 +11,7 @@ type HttpParamsGet = {
}
type HttpParamsPost = {
url: string
data?: Object
data?: string | Object | ArrayBuffer
query?: Record<string, string> | Object
headers?: Record<string, string>
}

查看文件

@ -0,0 +1,20 @@
import { HashMap } from "@kit.ArkTS";
/**
* ,ets里面不能用
*/
export class ToolsHelperForTS {
// Map转为Record
static mapToRecord(myMap: HashMap<string, string>): Record<string, string> {
return Object.fromEntries(myMap.entries()) as Record<string, string>;
}
// Record转为Map
static recordToMap(myRecord: Record<string, string>): HashMap<string, string> {
let myMap: HashMap<string, string> = new HashMap();
for (const key in myRecord) {
myMap.set(key, myRecord[key]);
}
return myMap;
}
}