🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

tokeys

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tokeys

Given an array, create an object with matching keys and values.

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
27
92.86%
Maintainers
1
Weekly downloads
 
Created
Source

Tokeys

Take an array of strings and turn it into an object with matching keys/values. This is used mostly for Flux constants.

var Constants = Tokeys([
    'CREATE_ITEM',
    'UPDATE_ITEM',
    'DELETE_ITEM'
]);

Creates:

{ 
    CREATE_ITEM: 'CREATE_ITEM', 
    UPDATE_ITEM: 'UPDATE_ITEM', 
    DELETE_ITEM: 'DELETE_ITEM' 
}

Which can be used like Constants.CREATE_ITEM when passing in constants to a Flux action, for example.

Keywords

flux

FAQs

Package last updated on 29 Apr 2016

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