Files
xen-orchestra/packages/value-matcher
2020-09-07 10:26:51 +02:00
..
2018-02-09 17:56:03 +01:00
2018-02-26 22:30:37 +01:00
2020-09-07 10:26:51 +02:00
2020-09-07 10:26:51 +02:00

value-matcher

Package Version License PackagePhobia Node compatibility

Install

Installation of the npm package:

> npm install --save value-matcher

Usage

import { createPredicate } from 'value-matcher'
;[
  { user: 'sam', age: 65, active: false },
  { user: 'barney', age: 36, active: true },
  { user: 'fred', age: 40, active: false },
].filter(
  createPredicate({
    __or: [{ user: 'sam' }, { active: true }],
  })
)
// [
//   { user: 'sam', age: 65, active: false },
//   { user: 'barney', age: 36, active: true },
// ]

Contributions

Contributions are very welcomed, either on the documentation or on the code.

You may:

  • report any issue you've encountered;
  • fork and create a pull request.

License

ISC © Vates SAS