@everlast-brands/utility-functions
v0.1.2
Published
Collection of approved functions.
Downloads
7
Readme
Utility Functions
Set of agnostic utility functions to work with arrays, dates, numbers, and strings.
btoa()
Encode string to base64
atob()
Decode base 64 string
decodeEntities()
Decode common HTML Entities
formatDate()
Formates a unix or js epoch date number
formatDateFull()
Formats a unix or js epoch date number to mm/dd/yyyy
formatDatePartial()
Formates a unix or js epoch date number
formatDateTime()
Formates a unix or js epoch date number
convertHTMLDate()
parse html date to js date
formatEnum()
convert THIS_AND_THIS to "This and this"
formatMacroCase()
convert THIS_AND_THIS to "This And This"
formatMoney()
convert this 1000 to $1,000.00
formatPhone()
convert this 1234567890 to 123-456-7890
formatPhoneSimple()
conver this 1234567890 to (123) 456-7890
generateKey()
Create a random string
getItemById()
pull an object from an array by the object id property
mergeArraysNoDuplicates()
merge arrays together removing duplicates
propSort()
sort an array of objects by a particular object property
nestedPropSort()
sort an array of objects by a particular nested property
slugify()
takes a string and normalizes it for a url slug