@mgarlik/json-filter
v1.0.1
Published
JSON filter engine for backend and frontend applications
Maintainers
Readme
@mgarlik/json-filter
Shared TypeScript filter/rule engine for backend and frontend applications.
Scripts
npm run build- compile package todist/and generate type declarationsnpm test- run unit tests with Vitestnpm run test:watch- run tests in watch modenpm run lint- type-check source code
Usage
import { matchJson, type JsonFilter } from "@mgarlik/json-filter";
type Product = {
status: string;
price: number;
};
const filter: JsonFilter<Product> = {
status: { $eq: "active" },
price: { $gte: 100 },
};
const ok = matchJson({ status: "active", price: 120 }, filter);Documentation
Publish
- Update version in
package.json. - Run
npm run build. - Publish with
npm publish.
