$ npm install toxic-utils
utils collection
npm install toxic-utils --save
if you are using flow, you should import our flow defination, by adding this to your .flowconfig.
[ignore]
[include]
[libs]
./node_modules/toxic-utils/lib/index.flow.js
[options]
[lints]
the handler to generate an deep traversal handler
Parameters
fn Function the function you wanna run when you reach in the deep propertyReturns Function the handler
deeply clone an object
Parameters
Returns clone-target the new Object
merge multiple objects
Parameters
args ...Object [description]Returns merge-object [description]
camelize any string, e.g hello world -> helloWorld
Parameters
Returns string camelize string
hypenate any string e.g hello world -> hello-world
Parameters
str string only accept stringReturns string
bind the function with some context. we have some fallback strategy here
Parameters
fn function the function which we need to bind the context oncontext any the context objectReturns Function
generate an uuid
Returns string
generate an random number which length is 4
Returns string
generate an random number with specific length
Parameters
length numberReturns string
get an deep property
Parameters
obj anykeys (string | Array<string>)$2 any (optional, default {})
$2.throwError (optional, default false)$2.backup© 2010 - cnpmjs.org x YWFE | Home | YWFE