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

    Keywords

    Install

    npm i matching

    DownloadsWeekly Downloads

    3

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • fgnass