Skip to content

Commit

Permalink
tools: fix incorrect version history order
Browse files Browse the repository at this point in the history
This fixes an error in parseYAML(text), the version sorting
coudn't be right as we compared an arrify string (ie. a = ["v18.11, v16.7.0"])
with an array of strings (ie. b = ["v18.07", "v16.7.0"]) in versionSort(a, b).

minVersion(a) couldn't find the minimum version with an arrify string like
a = ["v18.11, v16.7.0"].
That's why incorrect version history orders sometimes appeared.

Fixes: nodejs#45670
  • Loading branch information
welfoz committed Dec 3, 2022
1 parent f6052c6 commit 7b9432f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/doc/html.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -325,18 +325,18 @@ function parseYAML(text) {
const removed = { description: '' };

if (meta.added) {
added.version = meta.added.join(', ');
added.version = meta.added;
added.description = `<span>Added in: ${added.version}</span>`;
}

if (meta.deprecated) {
deprecated.version = meta.deprecated.join(', ');
deprecated.version = meta.deprecated;
deprecated.description =
`<span>Deprecated since: ${deprecated.version}</span>`;
}

if (meta.removed) {
removed.version = meta.removed.join(', ');
removed.version = meta.removed;
removed.description = `<span>Removed in: ${removed.version}</span>`;
}

Expand Down

0 comments on commit 7b9432f

Please sign in to comment.