xen-orchestra/packages/complex-matcher
Julien Fontanet 2a70ebf667 docs: uniformize code blocks
- add missing syntaxes
- don't put prompt if no command outputs to ease copy/paste and use `sh` syntax
- always use `$` as prompt and use `console` syntax
2023-02-06 11:25:12 +01:00
..
.npmignore feat: unified .npmignore for all packages 2021-04-07 13:58:14 +02:00
.USAGE.md chore: hide USAGE.md 2022-02-18 17:11:52 +01:00
index.bench.js chore(complex-matcher): remove build step 2022-06-22 09:55:59 +02:00
index.fixtures.js chore(complex-matcher): remove build step 2022-06-22 09:55:59 +02:00
index.js fix(complex-matcher): properly alias RegExp export as RegExpNode () 2022-08-22 10:44:07 +02:00
index.test.js chore: format with Prettier 2022-11-22 17:30:14 +01:00
package.json test(complex-matcher): from Jest to test () 2022-11-16 23:24:32 +01:00
README.md docs: uniformize code blocks 2023-02-06 11:25:12 +01:00

complex-matcher

Package Version License PackagePhobia Node compatibility

Advanced search syntax used in XO

Install

Installation of the npm package:

npm install --save complex-matcher

Usage

import * as CM from 'complex-matcher'

const characters = [
  { name: 'Catwoman', costumeColor: 'black' },
  { name: 'Superman', costumeColor: 'blue', hasCape: true },
  { name: 'Wonder Woman', costumeColor: 'blue' },
]

const predicate = CM.parse('costumeColor:blue hasCape?').createPredicate()

characters.filter(predicate)
// [
//   { name: 'Superman', costumeColor: 'blue', hasCape: true },
// ]

new CM.String('foo').createPredicate()

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