bluechip-utils
Version:
Utitity function package for javsacript and Typescript
28 lines (27 loc) • 1.22 kB
TypeScript
/**
* Generates unique code
* @param length Length of unique code
* @param isUppercase - Whether the string returned should be uppercase
* @returns Generated string
*/
export declare const generateUniqueCode: (length: number, isUppercase?: boolean | undefined) => string;
export declare const readCsvFile: (url: string) => Promise<Object[]>;
export declare const generateUUID: () => string;
export declare const adaptExpressRequest: (req: any) => AppAdaptedRequest;
export declare const upperFirstCharacter: (word: string) => string;
export declare const isValidEmail: (email: string) => boolean;
export declare const isValidPhoneNumber: (phone: string) => boolean;
export declare const getDateStringFromTime: (time: number) => string;
export declare const camelizeCase: (item: any) => any;
export declare const convertToNameCase: (text: string) => string;
export declare const convertWordToSentenceCase: (text: string) => string;
export declare function splitArrayIntochunks(arr: any[], chunk: number): any[];
export declare const shuffleArray: (array: any[]) => any[];
export interface AppAdaptedRequest {
path: any;
method: any;
pathParams: any;
queryParams: any;
body: any;
user: any;
}