Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

toxic-utils

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toxic-utils

utils

  • 0.1.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
133
increased by87.32%
Maintainers
1
Weekly downloads
 
Created
Source

toxic-utils

Build Status Coverage Status npm dependency Status devDependency Status

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

Keywords

FAQs

Package last updated on 07 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc