Skip to content

Commit

Permalink
feat: include releaseDate
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleytodd committed Oct 17, 2023
1 parent 31c43b9 commit f5f78a5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ interface VersionInfo {
lts?: Date;
maintenance?: Date;
end?: Date;
releaseDate: Date;
}

declare function nv(alias?: string|string[], opts?: Options): Promise<VersionInfo[]>;
Expand Down
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ async function getLatestVersionsByCodename (now, cache, mirror) {
start: s && s.start && new Date(s.start),
lts: s && s.lts && new Date(s.lts),
maintenance: s && s.maintenance && new Date(s.maintenance),
end: s && s.end && new Date(s.end)
end: s && s.end && new Date(s.end),
releaseDate: new Date(ver.date)
}

// All versions get added to all
Expand Down
1 change: 1 addition & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ suite('nv', () => {
assert.strictEqual(typeof versions[0].patch, 'number')
assert.strictEqual(versions[0].codename, 'dubnium')
assert.strictEqual(versions[0].versionName, 'v10')
assert.strictEqual(versions[0].releaseDate.toISOString(), '2021-04-06T00:00:00.000Z')
assert.strictEqual(versions[0].start.toISOString(), '2018-04-24T00:00:00.000Z')
assert.strictEqual(versions[0].lts.toISOString(), '2018-10-30T00:00:00.000Z')
assert.strictEqual(versions[0].maintenance.toISOString(), '2020-05-19T00:00:00.000Z')
Expand Down

0 comments on commit f5f78a5

Please sign in to comment.