matching

1.0.0 • Public • Published

Build Status

Tiny utility to filter lists by example

Example:

var matching = require('matching');
 
var list = [
  { type: 'foo', foo: 23 },
  { type: 'foo', foo: 42 },
  { type: 'bar', bar: 23 }
];
 
var foo = matching({ type: 'foo' }, list);
// => [ { type: 'foo', foo: 23 }, { type: 'foo', foo: 42 } ]

About

This package has been written to accompany tools like flatten, uniqs or intersect as simple and lightweight alternative to utility collections like underscore or lodash where you could achieve the same result like this:

_.where(list, {type: 'foo'});

The order of the arguments has been reveresed to allow currying.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    1

Package Sidebar

Install

npm i matching

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • fgnass