Skip to content

Commit

Permalink
deps: semver@7.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wraithgar committed Feb 22, 2024
1 parent d6521ac commit a13808e
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 25 deletions.
18 changes: 13 additions & 5 deletions node_modules/semver/functions/coerce.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,42 @@ const coerce = (version, options) => {

let match = null
if (!options.rtl) {
match = version.match(re[t.COERCE])
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])
} else {
// Find the right-most coercible string that does not share
// a terminus with a more left-ward coercible string.
// Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
// With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
//
// Walk through the string checking with a /g regexp
// Manually set the index so as to pick up overlapping matches.
// Stop when we get a match that ends at the string end, since no
// coercible string can be more right-ward without the same terminus.
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]
let next
while ((next = re[t.COERCERTL].exec(version)) &&
while ((next = coerceRtlRegex.exec(version)) &&
(!match || match.index + match[0].length !== version.length)
) {
if (!match ||
next.index + next[0].length !== match.index + match[0].length) {
match = next
}
re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length
}
// leave it in a clean state
re[t.COERCERTL].lastIndex = -1
coerceRtlRegex.lastIndex = -1
}

if (match === null) {
return null
}

return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
const major = match[2]
const minor = match[3] || '0'
const patch = match[4] || '0'
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''
const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''

return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)
}
module.exports = coerce
9 changes: 7 additions & 2 deletions node_modules/semver/internal/re.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,17 @@ createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)

// Coercion.
// Extract anything that could conceivably be a part of a valid semver
createToken('COERCE', `${'(^|[^\\d])' +
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
createToken('COERCEFULL', src[t.COERCEPLAIN] +
`(?:${src[t.PRERELEASE]})?` +
`(?:${src[t.BUILD]})?` +
`(?:$|[^\\d])`)
createToken('COERCERTL', src[t.COERCE], true)
createToken('COERCERTLFULL', src[t.COERCEFULL], true)

// Tilde ranges.
// Meaning is "reasonably at or greater than"
Expand Down
17 changes: 4 additions & 13 deletions node_modules/semver/package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"name": "semver",
"version": "7.5.4",
"version": "7.6.0",
"description": "The semantic version parser used by npm.",
"main": "index.js",
"scripts": {
"test": "tap",
"snap": "tap",
"lint": "eslint \"**/*.js\"",
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
"postlint": "template-oss-check",
"lintfix": "npm run lint -- --fix",
"posttest": "npm run lint",
"template-oss-apply": "template-oss-apply --force"
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.17.0",
"@npmcli/template-oss": "4.21.3",
"tap": "^16.0.0"
},
"license": "ISC",
Expand Down Expand Up @@ -53,17 +53,8 @@
"author": "GitHub Inc.",
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.17.0",
"version": "4.21.3",
"engines": ">=10",
"ciVersions": [
"10.0.0",
"10.x",
"12.x",
"14.x",
"16.x",
"18.x"
],
"npmSpec": "8",
"distPaths": [
"classes/",
"functions/",
Expand Down
35 changes: 31 additions & 4 deletions package-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
"proc-log": "^3.0.0",
"qrcode-terminal": "^0.12.0",
"read": "^2.1.0",
"semver": "^7.5.4",
"semver": "^7.6.0",
"spdx-expression-parse": "^3.0.1",
"ssri": "^10.0.5",
"supports-color": "^9.4.0",
Expand Down Expand Up @@ -916,6 +916,33 @@
"node": ">=v18"
}
},
"node_modules/@commitlint/is-ignored/node_modules/lru-cache": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
"dev": true,
"dependencies": {
"yallist": "^4.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/@commitlint/is-ignored/node_modules/semver": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/@commitlint/lint": {
"version": "18.4.4",
"resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-18.4.4.tgz",
Expand Down Expand Up @@ -11985,9 +12012,9 @@
}
},
"node_modules/semver": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"version": "7.6.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",
"integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==",
"inBundle": true,
"dependencies": {
"lru-cache": "^6.0.0"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"proc-log": "^3.0.0",
"qrcode-terminal": "^0.12.0",
"read": "^2.1.0",
"semver": "^7.5.4",
"semver": "^7.6.0",
"spdx-expression-parse": "^3.0.1",
"ssri": "^10.0.5",
"supports-color": "^9.4.0",
Expand Down

0 comments on commit a13808e

Please sign in to comment.