Skip to content

Commit

Permalink
chore(common-docs): switched from '+' to Number() for more explicit c…
Browse files Browse the repository at this point in the history
…onversion
  • Loading branch information
lexasq committed Jul 2, 2024
1 parent 39e5415 commit 6aac09f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export class TopMenuComponent implements AfterViewInit {
.get<{ url: string; version: string; unprefixedUrl: string }[]>('assets/json/versions.json')
.subscribe((data) => {
this.previousDocs = data.sort((versionA, versionB) => {
const versionAsNumberA = +versionA.version.split('.').join('');
const versionAsNumberB = +versionB.version.split('.').join('');
const versionAsNumberA = Number(versionA.version.split('.').join(''));
const versionAsNumberB = Number(versionB.version.split('.').join(''));
return versionAsNumberB - versionAsNumberA;
});
});
Expand Down

0 comments on commit 6aac09f

Please sign in to comment.