A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/npm/cli/commit/8a911ff895967678aa786595db3418fc28e6966a below:

disregard deprecated versions when calculating highest … · npm/cli@8a911ff · GitHub

File tree Expand file treeCollapse file tree 2 files changed

+5

-1

lines changed

Filter options

Expand file treeCollapse file tree 2 files changed

+5

-1

lines changed Original file line number Diff line number Diff line change

@@ -217,7 +217,10 @@ class Publish extends BaseCommand {

217 217

const ordered = Object.keys(packument?.versions)

218 218

.flatMap(v => {

219 219

const s = new semver.SemVer(v)

220 -

return s.prerelease.length > 0 ? [] : s

220 +

if ((s.prerelease.length > 0) || packument.versions[v].deprecated) {

221 +

return []

222 +

}

223 +

return s

221 224

})

222 225

.sort((a, b) => b.compare(a))

223 226

return ordered.length >= 1 ? ordered[0].version : null

Original file line number Diff line number Diff line change

@@ -876,6 +876,7 @@ t.test('semver highest dist tag', async t => {

876 876

// this needs more than one item in it to cover the sort logic

877 877

{ version: '50.0.0' },

878 878

{ version: '100.0.0' },

879 +

{ version: '102.0.0', deprecated: 'oops' },

879 880

{ version: '105.0.0-pre' },

880 881

]

881 882

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4