tj / node-only

return whitelisted properties of an object
MIT License
168 stars 19 forks source link

Only for map #10

Closed franciscop closed 5 years ago

franciscop commented 6 years ago

This is a very nice library. There is a pattern that I think would be awesome if it was supported. For this data definition, common in many situations:

const data = [{ a: 'b', c: 'd' }, { a: 'e', c: 'f' }];

I really like doing this:

const newData = data.map(only('a'));

I have a small library that I'm using, but was wondering if:

Otherwise I'll just publish it as a tiny lib, just wondering if it's possible currently.