Return whitelisted properties of an object.
$ npm install @edgeros/only
An array or space-delimited string may be given:
var obj = {
name: 'tobi',
last: 'holowaychuk',
email: 'tobi@learnboost.com',
_id: '12345'
};
var user = only(obj, ['name', 'last', 'email']);
yields:
{
name: 'tobi',
last: 'holowaychuk',
email: 'tobi@learnboost.com'
}
MIT