Get unlimited public & private packages + team-based management with npm Teams.Learn more »

constant-mirror

2.0.1 • Public • Published

constant-mirror npm npm

A simple tool for creating objects with keys mirrored as values. Inspired by React's keyMirror.

Install

npm install --save constant-mirror

Usage

// ES6
import mirror from 'constant-mirror';
// or ES5
var mirror = require('constant-mirror');
 
mirror('HELLO', 'WORLD');
// => { HELLO: 'HELLO', WORLD: 'WORLD' }

Symbol Mirror

// ES6
import mirror from 'constant-mirror/lib/symbol';
// or ES5
var mirror = require('constant-mirror/lib/symbol');
 
mirror('HELLO', 'WORLD');
// => { HELLO: Symbol(HELLO), WORLD: Symbol(WORLD) }

License

MIT © Griffin Yourick

Install

npm i constant-mirror

DownloadsWeekly Downloads

151

Version

2.0.1

License

MIT

Unpacked Size

5.76 kB

Total Files

5

Last publish

Collaborators

  • avatar