Functions for any projects Typescript
Modules and function for global use typescript using jest for tests.
npm i alvitre-obelisk
yarn add alvitre-obelisk
Date US and JS to PTBR format
>dateFormatPtbr("1992-06-10")
return 10/06/1992
Date JS to US format
>dateFormatUs(new Date("1992,06,10"))
return 1992-06-10
Date US to JS full format
>dateFormatJS(new Date("1992-06-10"))
return 1992-06-10T03:00:00.000Z
Verify with token is valid string
>validarToken(null)
return false
>validarToken(undefined)
return false
Calculate age with months of life
>calcYearsOldWithMounths("1993-06-10")
return "28 anos e 6 meses"
Cut string adding points
>limitText("lorem ipsum", 3)
return "lor ..."