Skip to content

🪄 A declarative JavaScript library for search params orchestration.

License

Notifications You must be signed in to change notification settings

maxprilutskiy/filterion

Repository files navigation

Filterion

Build Status codecov CodeFactor

Immutable data structure for filter criteria management.

Install

Install filterion using yarn or npm:

$ yarn add filterion
# or
$ npm i filterion

Then require it into any module:

import { Filterion } from 'filterion';

const filter = new Filterion()
  .add('device', 'iPhone')
  .add('price', 100, '>')
  .add('price', 200, '<');

console.log(filter.payload);

/*
{
  device: { '=': [ 'iPhone' ] },
  price: { '>': [ 100 ], '<': [ 200 ] }
}
*/