tuple
v0.0.1
Published
Dynamic key object creation utility
Downloads
23
Readme
tuple
Dynamic key object creation utility.
Installation
$ component install component/tuple
$ npm install tuple
Example
Useful for when you find yourself doing something like:
var obj = {};
obj[someDynamicKey] = 'value';
db.query(obj);
which may now just be:
db.query(tuple(someDynamicKey, 'value));
API
tuple(key, value, ...)
Key / value pairs in sequence.
var t = require('tuple');
var key = 'name';
var obj = t(key, 'tobi');
// => { name: tobi }
License
MIT