1.0.4 • Published 7 years ago

mirror-array-to-object v1.0.4

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Mirror-Array-To-Object

Create an object with both keys and values equals to each index of array of strings.

Install

npm install mirror-array-to-object

Usage

var mirrorKeys = require('mirror-array-to-object');

// Create an object with the keys and values
// same as COLORS = {blue: 'blue', green: 'green', yellow: 'yellow', red: 'red'};
var COLORS = mirrorKeys(['blue', 'green', 'yellow', 'red']);

// Assign values
var blueColor = COLORS.blue;

// Check if any values exists in the original array
var isColorValid = !!COLORS[blueColor];

LICENSE

MIT Licensed

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.1

7 years ago