like
build a regex from user input for filtering data
installation
$ npm install like
usage
var like = var filter = var matches = items // or we could get a predicate function like so: var matches = items
note As of 0.3.0, matches are case-sensitive by default. Functions take an options parameter which takes a ignoreCase
option. Example:
api
Described using jsig:
type Predicate : (Value) => Boolean
like : (String, options: Object?) => RegExp
like.startsWith : (String, options: Object?) => RegExp
like.endsWith : (String, options: Object?) => RegExp
like.fn : (String, options: Object?) => Predicate
like.startsWithFn : (String, options: Object?) => Predicate
like.endsWithFn : (String, options: Object?) => Predicate
running the tests
$ git clone git@github.com:AgileDiagnosis/like.git && cd like$ npm install$ npm test
kudos to
substack for quotemeta
contributors
jden jason@denizac.org
license
MIT. (c) 2013 Agile Diagnosis hello@agilediagnosis.com. See LICENSE.md