0.2.0 • Published 9 months ago

@criterium/js v0.2.0

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

@criterium/js

@criterium/js is a component of the Criterium project that provides a predicate builder for filtering JavaScript arrays.

With @criterium/js, you can build predicates using an intuitive and expressive syntax, and use them to filter arrays of data based on specific criteria.

install

npm i @criterium/js

usage

import toPredicate from '@criterium/js';

const data = [
  {
    name: 'John',
    address: {
      city: 'SF',
    },
  },
];

const result = data.filter(
  toPredicate({
    address: {
      city: {
        $in: ['SF', 'NY'],
      },
    },
  }),
);
// result.length => 1
0.2.0

9 months ago

0.1.0

1 year ago

0.0.3

1 year ago

0.0.2

2 years ago

0.0.1

2 years ago