Socket
Socket
Sign inDemoInstall

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 5.0.3 to 6.0.0-rc.1

11

lib/esm/index.js

@@ -81,2 +81,13 @@ /**

export const satisfies = (version, range) => {
// handle multiple comparators
if (range.includes('||')) {
return range.split('||').some((r) => satisfies(version, r));
}
else if (range.includes(' ')) {
return range
.trim()
.replace(/\s{2,}/g, ' ')
.split(' ')
.every((r) => satisfies(version, r));
}
// if no range operator then "="

@@ -83,0 +94,0 @@ const m = range.match(/^([<>=~^]+)/);

@@ -87,2 +87,13 @@ (function (global, factory) {

const satisfies = (version, range) => {
// handle multiple comparators
if (range.includes('||')) {
return range.split('||').some((r) => satisfies(version, r));
}
else if (range.includes(' ')) {
return range
.trim()
.replace(/\s{2,}/g, ' ')
.split(' ')
.every((r) => satisfies(version, r));
}
// if no range operator then "="

@@ -89,0 +100,0 @@ const m = range.match(/^([<>=~^]+)/);

3

package.json
{
"name": "compare-versions",
"version": "5.0.3",
"version": "6.0.0-rc.1",
"description": "Compare semver version strings to find greater, equal or lesser.",

@@ -26,2 +26,3 @@ "repository": {

"build:umd": "rollup lib/esm/index.js --format umd --name compareVersions --sourcemap -o lib/umd/index.js",
"prepublishOnly": "npm run build",
"test": "c8 --reporter=lcov mocha -r ts-node/register test/**/*.ts"

@@ -28,0 +29,0 @@ },

@@ -93,3 +93,14 @@ /**

*/
export const satisfies = (version: string, range: string) => {
export const satisfies = (version: string, range: string): boolean => {
// handle multiple comparators
if (range.includes('||')) {
return range.split('||').some((r) => satisfies(version, r));
} else if (range.includes(' ')) {
return range
.trim()
.replace(/\s{2,}/g, ' ')
.split(' ')
.every((r) => satisfies(version, r));
}
// if no range operator then "="

@@ -96,0 +107,0 @@ const m = range.match(/^([<>=~^]+)/);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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