{"_id":"keymirror","_rev":"259693","name":"keymirror","description":"A simple utility for creating an object with values equal to its keys. Identical to react/lib/keyMirror","dist-tags":{"latest":"0.1.1"},"maintainers":[{"name":"strml","email":"samuel.trace.reed@gmail.com"}],"time":{"modified":"2021-06-03T16:40:26.000Z","created":"2014-06-05T12:19:31.565Z","0.1.1":"2014-12-21T07:00:57.225Z","0.1.0":"2014-06-05T12:19:31.565Z"},"users":{"306766053":true,"levisl176":true,"alexkval":true,"sheebz":true,"x4devs":true,"shipengyan":true,"monjer":true,"koko236":true,"iolo":true,"koorgoo":true,"yann86":true,"wfalkwallace":true,"nelix":true,"zhenghua":true,"xieranmaya":true,"vwal":true,"yanislavgalyov":true,"lifecube":true,"liugenbin":true,"elmorec":true,"koulmomo":true,"zhiquan_yu":true,"qqcome110":true,"meligatt":true,"canniee":true,"dillonace":true,"sunzhixun":true,"belcour":true},"author":{"name":"Samuel Reed","email":"sam@tixelated.com","url":"http://strml.net/"},"repository":{"type":"git","url":"https://github.com/STRML/keyMirror"},"versions":{"0.1.1":{"name":"keymirror","version":"0.1.1","description":"A simple utility for creating an object with values equal to its keys. Identical to react/lib/keyMirror","main":"index.js","author":{"name":"Samuel Reed","email":"sam@tixelated.com","url":"http://strml.net/"},"repository":{"type":"git","url":"https://github.com/STRML/keyMirror"},"licenses":[{"type":"Apache-2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"gitHead":"2dafae96f33088e3030804f1113543c3c6c130b7","bugs":{"url":"https://github.com/STRML/keyMirror/issues"},"homepage":"https://github.com/STRML/keyMirror","_id":"keymirror@0.1.1","scripts":{},"_shasum":"918889ea13f8d0a42e7c557250eee713adc95c35","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"strml","email":"samuel.trace.reed@gmail.com"},"maintainers":[{"name":"strml","email":"samuel.trace.reed@gmail.com"}],"dist":{"shasum":"918889ea13f8d0a42e7c557250eee713adc95c35","size":1470,"noattachment":false,"key":"/keymirror/-/keymirror-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/keymirror/download/keymirror-0.1.1.tgz"},"directories":{},"publish_time":1419145257225,"_cnpm_publish_time":1419145257225,"_hasShrinkwrap":false},"0.1.0":{"name":"keymirror","version":"0.1.0","description":"A simple utility for creating an object with values equal to its keys. Identical to react/lib/keyMirror","main":"index.js","author":{"name":"Samuel Reed","email":"sam@tixelated.com","url":"http://strml.net/"},"licenses":[{"type":"Apache-2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"_id":"keymirror@0.1.0","dist":{"shasum":"32f7d61188f9236fd22b79f74156a2c710ddafe7","size":1425,"noattachment":false,"key":"/keymirror/-/keymirror-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/keymirror/download/keymirror-0.1.0.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"strml","email":"samuel.trace.reed@gmail.com"},"maintainers":[{"name":"strml","email":"samuel.trace.reed@gmail.com"}],"directories":{},"publish_time":1401970771565,"_cnpm_publish_time":1401970771565,"_hasShrinkwrap":false}},"readme":"KeyMirror\n=========\n\nCreate an object with values equal to its key names.\n\nI thought `react/lib/keyMirror` was useful and wanted to reuse it without any dependencies.\n\nThis is not my code, this is property of Facebook.\n\nUsage\n-----\n\n`npm install keymirror`\n\n```javascript\nvar keyMirror = require('keyMirror');\nvar COLORS = keyMirror({blue: null, red: null});\nvar myColor = COLORS.blue;\nvar isColorValid = !!COLORS[myColor];\n```\n\nThe last line could not be performed if the values of the generated enum were\nnot equal to their keys.\n\nInput:  `{key1: val1, key2: val2}`\n\nOutput: `{key1: key1, key2: key2}`\n\nI sometimes use this with lodash - use the following upon your first use of lodash to mix it in:\n\n```javascript\nvar _ = require('lodash');\n_.mixin({keyMirror: require('keyMirror')});\n// Can now be used as _.keyMirror(object)\n```\n","_attachments":{},"homepage":"https://github.com/STRML/keyMirror","bugs":{"url":"https://github.com/STRML/keyMirror/issues"}}