npm package: @mauchero/helpers
Description: Generic functions to help dev
Author: mauchero
Latest version: 1.0.84

## helpers
Generic functions to help develop all apps

## to use:
`npm i @mauchero/helpers`
[helpers](https://www.npmjs.com/package/@mauchero/helpers)

## warning
- this repo is private, but the code is public in npm
- do not put sensitive/confidential information here

## current functions
1. **Shortcuts**
   - `clog(message?: any, ...optionalParams: any[])`
   - `cloj(value: any, space: string | number | undefined = 2)`
   - `cloe(message?: any, ...optionalParams: any[])`
   - `jstr(value: any, space: string | number | undefined = 2)`

2. **API Related**
   - `recordError(db: firebase.Firestore, errorInfo: any): Promise<void>`

3. **Mathematics**
   - `arraySum(array: number[]): number`
   - `round(number: number, decimals: number): number`
   - `roundFloor(number: number, decimals: number): number`
   - `roundCeil(number: number, decimals: number): number`
   - `average(array: number[]): number`
   - `getHighestBetweenTwo(value1: number, value2: number): number`
   - `getLowestBetweenTwo(value1: number, value2: number): number`
   - `intToFloat(intValue: number, decimals?: number): number`

4. **Generic**
   - `removeDuplicates(arr: any[]): any[]`
   - `copyToClipboardWeb(copyText: string): Promise<boolean>`
   - `isObjEmpty(obj: Object): boolean`
   - `openInNewTab(url: string): void`
   - `reloadPage(): void`
   - `onClickUrl(url: string): () => void`
   - `varToString(varObj: Object): string`
   - `buildMap(keys: (keyof Object)[], values: any[]): Object`
   - `isHex(hex: any): boolean`
   - `hex2Int(hex: any): number`
   - `sleep(milliseconds: number): void`
   - `string2Float(strNumber: string): number`
   - `fetchImage(imageUrl: string): Promise<void>`
   - `reorderListSmallestToLargest(oldList: any[], orderKeyParam: string): any[]`
   - `reorderListLargestToSmallest(oldList: any[], orderKeyParam: string): any[]`
   - `checkCpfNumberValidity(cpf: string): boolean`
   - `reorderListSubParam(oldList: Object[], orderKeyParam: keyof Object, orderKeySubParam: keyof Object): Object[]`

5. **Formatting Stuff**
   - `formatPrice(numFloat: number, fiatSymbol: "BRL" | "USD" = "BRL"): string`
   - `formatPercentage(numFloat: number, fractionDigits: number = 2): string`
   - `formatCpf(cpf: string): string`
   - `formatPhone(phone: string): string`
   - `formatDate(date: string): string`
   - `isDateValid(date: string): boolean`
   - `isUserMinor(birthDate: string, minAge: number): boolean`
   - `calculateAge(birthDateStr: string): number`
   - `getOnlyNumbers(str: string): string`
   - `float2INFormat(number: number, decimals: number): string`
   - `darkenHexColor(hexColor: string, factor: number): string`
   - `removeSpaces(inputString: string): string`
   - `replacePtBrCharacters(inputString: string): string`

6. **Time**
   - `secsToDateTime(secs: number): string`
   - `secsToLocaleDateTime(secs: number): string`
   - `toLongFormatDateTime(secs: number): Date`
   - `getLocalTimezoneOffset(): number`
   - `toTimestamp(strDate: string): number`
   - `adjustDateMonthToName(date: string): string`
   - `numberToMonth(month: string): string`