Nondigestible Purple Mayonnaise

npm

Need private packages and team management tools?Check out npm Orgs. »

underscore.excerpt

1.0.2 • Public • Published

Underscore.Excerpt  Build Status

Smarter select queries from Underscore.js collections.

var kitties = _.excerpt(felids, {
    species: 'cat',
    aggressive: { operator: '==', value: false }, // Has not remarks
    ageInDays: { operator: '<', value: 50 }
});

Usage

Underscore.Excerpt plugin extends filter method by custom operators. By default filter hash consists of primitive values, but if you want to get some flexibility, set an object with a comparative operator and argument value fields.

Available operators:

  • < for lower than
  • > for greater than
  • <= for lower than or equivalent
  • >= for greater than or equivalent
  • == for non-strict comparison (e.g. '' == false)
  • != for non-strict not equivalent
  • regexp for test a value with a regular expression

License

The MIT License.

install

npm i underscore.excerpt

Downloadsweekly downloads

4

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability