Last 12 weeks · 0 commits
4 of 6 standards met
At the moment, non-enumerable properties are removed from the return value. On one hand: Most functional utilities iterate on objects using standard , , etc. which ignore non-enumerable properties. Object spreading itself removes non-enumerable properties. The concept of a property being non-enumerable implies that it should not be iterated when being copied over. Non-enumerable properties are much less common on plain objects than on class instances, and this library is meant for plain objects. On the other hand, some users might not expect non-enumerable properties removal as a side effect of this library. For example: : this would remove if it is non-enumerable, even though the user operation only intended to exclude . : this would not include if it is non-enumerable, even though the user explicitly requested to include it. For predicate functions, the user intent is less clear. @sindresorhus What are your thoughts on this?
Repository: sindresorhus/filter-obj. Description: Filter object keys and values into a new object Stars: 105, Forks: 11. Primary language: JavaScript. Languages: JavaScript (79.2%), TypeScript (20.8%). License: MIT. Latest release: v6.1.0 (2y ago). Open PRs: 1, open issues: 1. Last activity: 2y ago. Community health: 85%. Top contributors: sindresorhus, ehmicky, Richienb, BendingBender, johansteffner, lo1tuma, SamVerschueren, ninevra.