tools_dj 1.0.88 → 1.0.89

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/lib/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { formatSizeOptions } from "./types";
1
2
  /** 2024-07-08 12:49 User: DJ
2
3
  * content: 删除数组重复的元素
3
4
  * let newArr = del_repeat(Arr)
@@ -288,7 +289,7 @@ export declare function objToFormData(obj: any, simplify?: boolean): FormData;
288
289
  * @param option.perUnit - 转换进制,默认为1024
289
290
  * @returns 格式化后的文件大小字符串
290
291
  */
291
- export declare function formatSize(num: any, option?: any): string;
292
+ export declare function formatSize(num: any, option?: formatSizeOptions): string;
292
293
  /** 2025/4/23 15:59 User: DJ
293
294
  * content: 层级树转换成为多叉树 或者转化成为带有左右属性的树
294
295
  * @param items 平级树结构数据
package/lib/types.d.ts ADDED
@@ -0,0 +1,9 @@
1
+ /** 格式化类型 DJ */
2
+ export interface formatSizeOptions {
3
+ /** 保留小数位数,默认为2位 */
4
+ decimals?: number;
5
+ /** 单位数组,默认为 ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'] */
6
+ sizes?: string[];
7
+ /** 转换进制,默认为1024 */
8
+ perUnit?: number;
9
+ }
package/lib/types.js ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,"__esModule",{value:!0});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tools_dj",
3
- "version": "1.0.88",
3
+ "version": "1.0.89",
4
4
  "description": "dj tools 工具库",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",