Skip to content

Commit

Permalink
fix!: codename should be null on non-lts (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleytodd committed Oct 19, 2023
1 parent dc42613 commit f08ab6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async function getLatestVersionsByCodename (now, cache, mirror) {
const aliases = versions.reduce((obj, ver) => {
const { major, minor, patch, tag } = splitVersion(ver.version)
const versionName = major !== '0' ? `v${major}` : `v${major}.${minor}`
const codename = ver.lts ? ver.lts.toLowerCase() : versionName
const codename = ver.lts ? ver.lts.toLowerCase() : null
const version = tag !== '' ? `${major}.${minor}.${patch}-${tag}` : `${major}.${minor}.${patch}`
const s = schedule[versionName]

Expand Down
5 changes: 5 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,9 @@ suite('nv', () => {
assert.strictEqual(versions[0].major, 0)
assert.strictEqual(versions[0].isLts, false)
})

test('codename null on non-lts', async () => {
const versions = await nv('0.8.0', { now })
assert.strictEqual(versions[0].codename, null)
})
})

0 comments on commit f08ab6d

Please sign in to comment.