We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f7f1af commit 97abe18Copy full SHA for 97abe18
lib/commands/publish.js
@@ -214,8 +214,10 @@ class Publish extends BaseCommand {
214
return null
215
}
216
const ordered = Object.keys(packument?.versions)
217
- .map(v => new semver.SemVer(v))
218
- .filter(v => !v.prerelease.length)
+ .flatMap(v => {
+ const s = new semver.SemVer(v)
219
+ return s.prerelease.length > 0 ? [] : s;
220
+ })
221
.sort((a, b) => b.compare(a))
222
return ordered.length >= 1 ? ordered[0].version : null
223
} catch (e) {
0 commit comments