semver-extra
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -8,3 +8,2 @@ 'use strict'; | ||
extra.isPrerelease = isPrerelease; | ||
extra.isExplicit = isExplicit; | ||
extra.max = max; | ||
@@ -33,8 +32,2 @@ extra.maxStable = maxStable; | ||
// Returns whether it is a explicit version | ||
function isExplicit (version) { | ||
var range = semver.validRange(version); | ||
return range === version; | ||
} | ||
function arrayEqual (a, b) { | ||
@@ -41,0 +34,0 @@ if (!util.isArray(a) || !util.isArray(b)) { |
{ | ||
"name": "semver-extra", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "semver-extra contains useful methods that aren't included in the vanilla semver package.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -53,13 +53,3 @@ # semver-extra [![NPM version](https://badge.fury.io/js/semver-extra.svg)](http://badge.fury.io/js/semver-extra) [![Build Status](https://travis-ci.org/kaelzhang/node-semver-extra.svg?branch=master)](https://travis-ci.org/kaelzhang/node-semver-extra) [![Dependency Status](https://gemnasium.com/kaelzhang/node-semver-extra.svg)](https://gemnasium.com/kaelzhang/node-semver-extra) | ||
### semver.isExplicit(version) | ||
```js | ||
semver.isExplicit('1.0.0'); // true | ||
semver.isExplicit('^1.1.0'); // false | ||
``` | ||
Checks whehter the `version` is an explicit version, i.e. it is not a range. | ||
```js | ||
var versions = [ | ||
@@ -66,0 +56,0 @@ '1.1.2' |
@@ -45,23 +45,2 @@ 'use strict'; | ||
describe("extra.isExplicit(version)", function(){ | ||
[ | ||
['1.2.3', true], | ||
['1.2.3-beta', true], | ||
['1.2.3-beta.1', true], | ||
// invalid range | ||
['abc', false], | ||
['1.2', false], | ||
['^1.2.3', false], | ||
['>1.2.3 <1.3.0', false] | ||
].forEach(function (c) { | ||
var v = c[0]; | ||
var r = c[1]; | ||
it(v + ': ' + r, function(){ | ||
expect(extra.isExplicit(v)).to.equal(r); | ||
}); | ||
}); | ||
}); | ||
describe("extra.max*()", function(){ | ||
@@ -68,0 +47,0 @@ var versions = [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8356
128
95