is-comparator-valid

Check if a semver comparator is valid

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
is-comparator-valid
011.1.25 years ago9 years agoMinified + gzip package size for is-comparator-valid in KB

Readme

is-comparator-valid Build Status Greenkeeper badge
Check if a semver comparator is valid

Install

$ npm install --save is-comparator-valid

Usage

var isValid = require('is-comparator-valid')
var Comparator = require('semver').Comparator
isValid(new Comparator('<2')) // => true
isValid(new Comparator('>0.0.0')) // => true
isValid(new Comparator('<0.0.0')) // => false

API

isValid(comparator) -> boolean

comparator
Required
Type: comparator
A semver.Comparator to test.

License

MIT © Ben Drucker