@hyoretsu/utils
v1.15.0
Published
A collection of utility functions that I use in my projects.
Downloads
167
Readme
List of utility functions:
- capitalize
- clamp - CSS-like clamp()
- degreesToRadians
- directLink - supports GDrive
- distanceBetweenCoordinates
- divmod
- fixNumber (that .00000000001 error)
- formatPhoneNumber (currently supports BR and US numbers)
- haversine and archaversine
- hexToHsl
- hexToRgba (RGB and RGBA)
- isEven
- isOdd
- isPowerOf
- JsonFixBigInt
- measureText – Measures how many pixels of height a given text will need (useful for dynamic universal animations)
- onlyUnique (filter helper)
- random (Python-like)
- randomId
- range
- round (More precise than Math.round)
- sleep (async)
- sum
- swap (in-place)
- timeConversion - Converts values from one time unit to another
- titleCase
- validHex
- zeroOrOne