chore: add full source code

This commit is contained in:
tone
2025-10-14 23:53:27 +08:00
parent e7b9228d70
commit ebb6407221
30 changed files with 6133 additions and 0 deletions

17
src/utils/utils.ts Normal file
View File

@@ -0,0 +1,17 @@
import md5 from 'md5';
export const makeId = () => md5(`${Date.now()}${Math.random()}`);
export const isObject = (v: unknown): v is Record<string, any> => typeof v === 'object' && v !== null;
export const isString = (v: unknown): v is string => typeof v === 'string';
export type ObjectType = Record<string, any>;
export type ToDeepPromise<T> = {
[K in keyof T]: T[K] extends (...args: infer P) => infer R
? (...args: P) => Promise<R>
: T[K] extends object
? ToDeepPromise<T[K]>
: T[K]
};