0.4.3 • Published 6 years ago

toxic-utils v0.4.3

Weekly downloads
211
License
MIT
Repository
github
Last release
6 years ago

toxic-utils

Build Status Coverage Status npm dependency Status devDependency Status Greenkeeper badge

utils collection

get started

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]

doc

genTraversalHandler

src/index.js:8-20

the handler to generate an deep traversal handler

Parameters

  • fn Function the function you wanna run when you reach in the deep property

Returns Function the handler

deepClone

src/index.js:27-32

deeply clone an object

Parameters

  • source (Array | Object) if you pass in other type, it will throw an error

Returns clone-target the new Object

deepAssign

src/index.js:38-50

merge multiple objects

Parameters

Returns merge-object description

camelize

src/index.js:57-63

camelize any string, e.g hello world -> helloWorld

Parameters

Returns string camelize string

hypenate

src/index.js:69-71

hypenate any string e.g hello world -> hello-world

Parameters

Returns string

bind

src/index.js:78-90

bind the function with some context. we have some fallback strategy here

Parameters

  • fn function the function which we need to bind the context on
  • context any the context object

Returns Function

uuid

src/index.js:95-97

generate an uuid

Returns string

S4

src/index.js:101-103

generate an random number which length is 4

Returns string

rand

src/index.js:108-114

generate an random number with specific length

Parameters

Returns string

getDeepProperty

src/index.js:119-147

get an deep property

Parameters

  • obj any
  • keys (string | Array<string>)
  • $2 any (optional, default {})
    • $2.throwError (optional, default false)
    • $2.backup
0.4.3

6 years ago

0.4.2

6 years ago

0.4.0

6 years ago

0.3.1

6 years ago

0.3.0

7 years ago

0.3.0-alpha.1

7 years ago

0.2.0

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago