Skip to content

Commit

Permalink
Merge pull request #1019 from arduino/dependabot/npm_and_yarn/semver-…
Browse files Browse the repository at this point in the history
…7.6.3

build(deps): bump semver from 7.6.2 to 7.6.3
  • Loading branch information
per1234 authored Aug 1, 2024
2 parents 397c82f + 3764cfd commit df756c1
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: semver
version: 7.6.2
version: 7.6.3
type: npm
summary: The semantic version parser used by npm.
homepage:
Expand Down
34 changes: 24 additions & 10 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8666,6 +8666,8 @@ const Range = __nccwpck_require__(9828)
/***/ 9828:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {

const SPACE_CHARACTERS = /\s+/g

// hoisted class for cyclic dependency
class Range {
constructor (range, options) {
Expand All @@ -8686,7 +8688,7 @@ class Range {
// just put it in the set and return
this.raw = range.value
this.set = [[range]]
this.format()
this.formatted = undefined
return this
}

Expand All @@ -8697,10 +8699,7 @@ class Range {
// First reduce all whitespace as much as possible so we do not have to rely
// on potentially slow regexes like \s*. This is then stored and used for
// future error messages as well.
this.raw = range
.trim()
.split(/\s+/)
.join(' ')
this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')

// First, split on ||
this.set = this.raw
Expand Down Expand Up @@ -8734,14 +8733,29 @@ class Range {
}
}

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
}

Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/tool-cache": "^2.0.1",
"semver": "^7.6.2",
"semver": "^7.6.3",
"typed-rest-client": "^2.0.2"
},
"devDependencies": {
Expand Down

0 comments on commit df756c1

Please sign in to comment.