New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

like

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

like

build a regex from user input for filtering data

  • 0.3.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

like

build a regex from user input for filtering data

installation

$ npm install like

usage

var like = require('like')

var filter = like(searchField.value)

var matches = items.filter(function (x) {
  return filter.test(x)
})

// or we could get a predicate function like so:

var matches = items.filter(like.fn(searchField.value))

note As of 0.3.0, matches are case-sensitive by default. Functions take an options parameter which takes a ignoreCase option. Example:

like('foo', {ignoreCase: true})

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

Keywords

FAQs

Package last updated on 18 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc