Comparing version 7.6.2 to 7.6.3
@@ -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`), |
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
95824
2131