constant-mirror

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

MIT 9 个版本
安装
npm install constant-mirror
yarn add constant-mirror
pnpm add constant-mirror
bun add constant-mirror
README

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

版本列表
2.0.1 2019-07-17
2.0.0 2019-07-17
1.1.1 2016-04-22
1.1.0 2016-04-22
1.0.6 2015-11-22
1.0.5 2015-09-16
1.0.2 2015-08-10
1.0.1 2015-08-09
1.0.0 2015-08-09