utils collection
npm install toxic-utils --saveif 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
fnFunction the function you wanna run when you reach in the deep property
Returns 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
strstring only accept string
Returns string
bind the function with some context. we have some fallback strategy here
Parameters
fnfunction the function which we need to bind the context oncontextany the context object
Returns Function
generate an uuid
Returns string
generate an random number which length is 4
Returns string
generate an random number with specific length
Parameters
lengthnumber
Returns string
get an deep property
Parameters