UNPKG

1.66 kBTypeScriptView Raw
1export declare const isEmpty: (obj?: {}) => boolean;
2export declare const sortByField: (list: any, field: any, dir: any) => boolean;
3export declare const objectLessAttributes: (obj: any, less: any) => any;
4export declare const filenameToContentType: (filename: any, defVal?: string) => string;
5export declare const isTextFile: (contentType: any) => boolean;
6export declare const generateRandomString: () => string;
7export declare const makeQuerablePromise: (promise: any) => any;
8export declare const isWebWorker: () => boolean;
9export declare const browserOrNode: () => {
10 isBrowser: boolean;
11 isNode: boolean;
12};
13/**
14 * transfer the first letter of the keys to lowercase
15 * @param {Object} obj - the object need to be transferred
16 * @param {Array} whiteListForItself - whitelist itself from being transferred
17 * @param {Array} whiteListForChildren - whitelist its children keys from being transferred
18 */
19export declare const transferKeyToLowerCase: (obj: any, whiteListForItself?: any[], whiteListForChildren?: any[]) => any;
20/**
21 * transfer the first letter of the keys to lowercase
22 * @param {Object} obj - the object need to be transferred
23 * @param {Array} whiteListForItself - whitelist itself from being transferred
24 * @param {Array} whiteListForChildren - whitelist its children keys from being transferred
25 */
26export declare const transferKeyToUpperCase: (obj: any, whiteListForItself?: any[], whiteListForChildren?: any[]) => any;
27/**
28 * Return true if the object is a strict object
29 * which means it's not Array, Function, Number, String, Boolean or Null
30 * @param obj the Object
31 */
32export declare const isStrictObject: (obj: any) => boolean;