filter-def
Easy, type-safe data filters in TypeScript. Define your filters once and get full type inference for filter inputs and results across in-memory arrays, Drizzle ORM, and BigQuery.
Key Features
Type-Safe
Full TypeScript inference for filter inputs and entity fields. Catch errors at compile time, not runtime.
Multi-Backend
Use the same filter patterns for in-memory arrays, Drizzle ORM, or BigQuery with zero lock-in.
Composable
Combine filters with AND/OR boolean logic to build complex queries from simple building blocks.
Extensible
Define custom filter functions with adapter-specific implementations for business logic.
Quick Example
Get Started
Installation
Install filter-def packages for your backend
Quickstart
Get up and running in 5 minutes
Core Concepts
Learn about filter definitions and types
API Reference
Explore the complete API documentation
Adapters
Choose the adapter that fits your data backend:In-Memory
Filter JavaScript arrays with native methods
Drizzle ORM
Generate SQL WHERE clauses for Drizzle
BigQuery
Create parameterized SQL for BigQuery