@deskpro/js-utils
Library of common js methods
Installation
The easiest way to use
js-utils
is to install it from npm and build it into your app with Webpack.
npm i @deskpro/js-utils --save
Numbers
Objects
Utilities
Allow to debounce a function
Generates a unique id value.
Provides an empty function to use as a default callback.
Numbers
Formats a number to include commas (or any separator) in the thousandths place.
Returns a random whole number between a minimum and maximum number.
Format a file size into a human readable string
Objects
Performs a key comparison between two objects, deleting from the first where the keys exist in the second.
Iterates over an object.
Creates an array from the results of calling a function on each item in an object.
Strings
Trim a string to a certain length with an ellipsis
Put the first letter of a string in capital