LoDashed
Lo-Dash, Underscore.string + some other useful functions in a single, powerful _
.
The "other" functions
.type( [variable] )
Return the type of a variable as a string.
_type; // => array_type; // => array_type{}; // => object_type; // => object
.uncapitalize( [str] )
Uncapitalize an string.
_; // "i AM MAD!"_; // "you're my hero!"
.replaceAll( str, token, newToken[, ignoreCase])
Replace all occurrences of an string, optionally checking the case.
_; // => Luke Skywal..._; // => Anakin Skywal..._; // => Luke Skywal...
.uuid()
Returns an UUID v4.
_; // => "9279f99f-0525-4079-95a6-3580ef272e71"
.byteFormat( bytes[, decimals=0][, decimalSeparator="."][, orderSeparator=","] )
Format an byte size, e.g. 1024 becomes 1 KB. You can also customize the output by providing how much decimals
you want and a decimalSeparator
and orderSeparator
.
_; // => "1 KB"_; // => "100 KB"
Tests
Run the following commands inside the project root:
npm install -dnpm test
License
MIT