Hasty Briefsbeta

Bilingual

Show HN: Fp-filters – A curated collection of TS/JS array filter functions

a year ago
  • #javascript
  • #functional-programming
  • #utility-library
  • A curated collection of 130+ common-use filter functions in functional programming style.
  • Improves code readability and reduces redundancy by eliminating the need to rewrite common filter functions.
  • Functions are grouped semantically and include examples like `isEven`, `isWeekend`, `isNotEmpty`, etc.
  • Supports negated versions of functions (e.g., `isNot`, `isNotBetween`) and leverages `fp-booleans` for combining or negating functions.
  • All functions are pure, some are higher-order, and most are one-liners with zero or minimal dependencies.
  • Functions are fully typed, tested (130+ unit tests), and optimized for tree-shaking to bundle only what you use.
  • Available as an npm package (`fp-filters`) with no barrel files, ensuring minimal bundle size.
  • Works on Node.js and includes detailed documentation and examples.