Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

compare-versions

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compare-versions - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

CHANGELOG.md

2

bower.json
{
"name": "compare-versions",
"version": "3.0.0",
"version": "3.0.1",
"description": "Compare semver version strings to find greater, equal or lesser.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -17,3 +17,3 @@ /* global define */

function split(v) {
var temp = v.split('.');
var temp = v.replace(/^v/, '').split('.');
var arr = temp.splice(0, 2);

@@ -20,0 +20,0 @@ arr.push(temp.join('.'));

{
"name": "compare-versions",
"version": "3.0.0",
"version": "3.0.1",
"description": "Compare semver version strings to find greater, equal or lesser.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,3 +8,3 @@ # compare-versions

This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. Also supports wildcards for minor and patch version like `1.0.x` or `1.0.*`.
This library supports the full semver specification, including comparing versions with different number of digits like `1.0.0`, `1.0`, `1`, and pre-release versions like `1.0.0-alpha`. Also supports wildcards for minor and patch version like `1.0.x` or `1.0.*`. Any leading `v` is ignored.

@@ -11,0 +11,0 @@ ## Install

@@ -66,2 +66,9 @@ var assert = require('assert');

it('should ignore leading `v`', function () {
assert.equal(compare('v1.0.0', '1.0.0'), 0);
assert.equal(compare('v1.0.0', 'v1.0.0'), 0);
assert.equal(compare('v1.0.0', 'v1.0.0'), 0);
assert.equal(compare('v1.0.0-alpha', '1.0.0-alpha'), 0);
});
it('should throw on invalid input', function () {

@@ -68,0 +75,0 @@ [

@@ -48,3 +48,4 @@ var assert = require('assert');

['3.2.1', '3.2.0'],
['v0.5.4-pre', '0.5.4-alpha']
['v0.5.4-pre', '0.5.4-alpha'],
['v3.2.1', 'v2.3.2']
].forEach(function (tuple) {

@@ -51,0 +52,0 @@ var v1 = tuple[0];

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