Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
})
})