Skip to content

Commit f866e65

Browse files
committed
fix!: codename should be null on non-lts (#21)
1 parent ee7a4b9 commit f866e65

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ async function getLatestVersionsByCodename (now, cache, mirror) {
8383
const aliases = versions.reduce((obj, ver) => {
8484
const { major, minor, patch, tag } = splitVersion(ver.version)
8585
const versionName = major !== '0' ? `v${major}` : `v${major}.${minor}`
86-
const codename = ver.lts ? ver.lts.toLowerCase() : versionName
86+
const codename = ver.lts ? ver.lts.toLowerCase() : null
8787
const version = tag !== '' ? `${major}.${minor}.${patch}-${tag}` : `${major}.${minor}.${patch}`
8888
const s = schedule[versionName]
8989

test/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,9 @@ suite('nv', () => {
177177
assert.strictEqual(versions[0].major, 0)
178178
assert.strictEqual(versions[0].isLts, false)
179179
})
180+
181+
test('codename null on non-lts', async () => {
182+
const versions = await nv('0.8.0', { now })
183+
assert.strictEqual(versions[0].codename, null)
184+
})
180185
})

0 commit comments

Comments
 (0)