Files
NapCatQQ/.pnpm-store/v3/files/b9/490542e57e72d021d2b8fcb883815708b15e02f3b0467c734b342cc980d93524826332c5748ceef5f4cc016b583f983818d36da04372acdc6074e61afe7cd2
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

32 lines
1.2 KiB
Plaintext

type Key = string | number;
interface MergeObject {
[key: string]: any;
}
declare const renameProp: (oldProp: string, newProp: string, { [oldProp]: old, ...others }: {
[x: string]: any;
}) => {
[x: string]: any;
};
declare const copyObject: (obj: any) => any;
declare const omitObject: (obj: any, omitKeys: string[]) => any;
declare const cleanObject: (obj: any) => any;
declare const cleanObjectKeys: (obj: any, keys?: string[]) => any;
declare const getKeyValue: (obj: any, key: Key) => any;
/**
* Get value from a deeply nested object using a string path.
* Memorizes the value.
* @param obj - the object
* @param path - the string path
* @param fallback - the fallback value
*/
declare const getProp: (obj: Record<string, any>, path: string | number, fallback?: any, index?: number) => any;
/**
* Converting an array of objects into a single object.
* @param arr - the array of objects
* @returns the single object
*/
declare const arrayToObject: (arr: any[]) => any;
declare function compact<T extends Record<any, any>>(object: T): {} & T;
export { MergeObject, arrayToObject, cleanObject, cleanObjectKeys, compact, copyObject, getKeyValue, getProp, omitObject, renameProp };