feat(number): 优化函数文档并添加新功能

- 为所有函数添加了详细的 JSDoc 注释
- 新增 objectToJSON 函数
- 更新了 index.js 和类型定义文件
This commit is contained in:
2025-02-18 01:11:15 +08:00
parent 3c1d369b36
commit 54eca6b55d
3 changed files with 80 additions and 25 deletions

8
types/index.d.ts vendored
View File

@@ -8,6 +8,10 @@ declare module 'ddmt-tool' {
export function randomNum(minNum: number): number;
export function randomNum(minNum: number, maxNum: number): number;
export function nextArray(arr: any[], index: number): any[];
export function parseNginxLog(log: string): object;
export function ArrayDeHeavy(arr: any[]): any[];
export function getRelativeTime(date: Date): string;
export function parseNginxLog(log: string): { ip: string, timestamp: string, method: string, url: string, status: number, responseSize: number, referrer: string, userAgent: string } | null;
export function toCookiesArray(cookies: string): { [key: string]: string };
export function updateCookies(cookies: string, setCookieArray: string[]): string;
export function objectToJSON(ObjectText: string): string | undefined;
}