tj / node-only

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

Support for nested objects. #8

Open LeonardoCardoso opened 8 years ago

LeonardoCardoso commented 8 years ago

It would be nice if there was support for nested objects.

var obj = {
    name: 'tobi',
    last: 'holowaychuk',
    email: 'tobi@learnboost.com',
    _id: '12345',
    info: {
        logged_at: "2016-08-05T14:48:52Z",
        updated_at: "2016-08-05T14:48:52Z"
    }
};
joeljuca commented 6 years ago

Hi @LeonardoCardoso,

this issue is quite old and it seems that @tj couldn't put much attention to it, but I believe the reason for that is that it would break the single responsibility principle, which makes this module small, simple and easily maintainable.

You can always create a package that would use only to filter nested objects, as well as arrays, etc.

jeffhuys commented 6 years ago

@LeonardoCardoso @joelwallis see: http://github.com/jeffhuys/ronly