Socket
Socket
Sign inDemoInstall

semver

Package Overview
Dependencies
Maintainers
5
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

semver - npm Package Compare versions

Comparing version 7.6.2 to 7.6.3

34

classes/range.js

@@ -0,1 +1,3 @@

const SPACE_CHARACTERS = /\s+/g
// hoisted class for cyclic dependency

@@ -21,3 +23,3 @@ class Range {

this.set = [[range]]
this.format()
this.formatted = undefined
return this

@@ -33,6 +35,3 @@ }

// future error messages as well.
this.raw = range
.trim()
.split(/\s+/)
.join(' ')
this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')

@@ -71,10 +70,25 @@ // First, split on ||

this.format()
this.formatted = undefined
}
get range () {
if (this.formatted === undefined) {
this.formatted = ''
for (let i = 0; i < this.set.length; i++) {
if (i > 0) {
this.formatted += '||'
}
const comps = this.set[i]
for (let k = 0; k < comps.length; k++) {
if (k > 0) {
this.formatted += ' '
}
this.formatted += comps[k].toString().trim()
}
}
}
return this.formatted
}
format () {
this.range = this.set
.map((comps) => comps.join(' ').trim())
.join('||')
.trim()
return this.range

@@ -81,0 +95,0 @@ }

{
"name": "semver",
"version": "7.6.2",
"version": "7.6.3",
"description": "The semantic version parser used by npm.",

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

@@ -462,3 +462,3 @@ semver(1) -- The semantic versioner for npm

are equal. Sorts in ascending order if passed to `Array.sort()`.
* `compareLoose(v1, v2)`: Short for ``compare(v1, v2, { loose: true })`.
* `compareLoose(v1, v2)`: Short for `compare(v1, v2, { loose: true })`.
* `diff(v1, v2)`: Returns the difference between two versions by the release type

@@ -465,0 +465,0 @@ (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),

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