GitShow/sindresorhus/filter-obj
sindresorhus

filter-obj

Filter object keys and values into a new object

by sindresorhus
Star on GitHubForknpm

JavaScript

105 stars11 forks8 contributorsQuiet · 2y agoSince 2015v6.1.0MIT

Meet the team

See all 8 on GitHub →
sindresorhus
sindresorhus23 contributions
ehmicky
ehmicky8 contributions
Richienb
Richienb5 contributions
BendingBender
BendingBender1 contribution
johansteffner
johansteffner1 contribution
lo1tuma
lo1tuma1 contribution
SamVerschueren
SamVerschueren1 contribution
ninevra
ninevra1 contribution

Languages

View on GitHub →
JavaScript79.2%
TypeScript20.8%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · 1 in progress · Last activity 2y ago
See all on GitHub →
ehmicky
Keeping non-enumerable propertiesOpenIssue

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?

ehmicky · 9mo ago
gmaclennan
fix: Fix includeKeys return type when passing a union of objectsOpenPR

Similar to #34, this uses a distributive conditional type that returns the correct type when using on a union type. I'm not sure if there is a strange edge-case that means this does not work as-expected for , I don't want to break types for regular use.

gmaclennan · 10mo ago

Recent fixes

View closed PRs →
Richienb
Support `Set`sClosedIssue

Since the array case treats it like an iterable, we could replace the check with for a check with . We shouldn't just use because: https://github.com/sindresorhus/is#why-not-just-use-instanceof-instead-of-this-package

Richienb · 2y ago
Richienb
Support specifying a `Set` of keys MergedPR

Fixes #35

Richienb · 2y ago
lo1tuma
Fix excludeKeys return type when passing in a union of objectsMergedPR

The builtin type doesn’t work correctly for union types. Using a distributive conditional type allows to apply the exclusion of the given key(s) for all members of the union.

lo1tuma · 2y ago
Structured data for AI agents

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.

·@ofershap

Replace github.com with gitshow.dev