Socket
Book a DemoInstallSign in
Socket

match-condition

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

match-condition

Check if a value matches a condition

latest
Source
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

match-condition Build Status

Check if a value matches a condition

Install

$ npm install --save match-condition

Usage

var matchCondition = require('match-condition');

matchCondition('unicorns', 'unicorns');
//=> true

matchCondition('unicorns', /^unicorns$/);
//=> true

matchCondition('unicorns', '*corns');
//=> true

matchCondition('unicorns', function (val) {
	return val === 'unicorns';
});
//=> true

API

matchCondition(value, condition)

value

Required
Type: mixed

Value to be matched.

condition

Required
Type: function, string, glob, boolean or regex

Condition to match the value against.

License

MIT © Kevin Martensson

Keywords

check

FAQs

Package last updated on 24 May 2015

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