Skip to content

Commit

Permalink
fix(wpt): order version keys alphabetically (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Feb 22, 2021
1 parent d6fad2a commit 308982b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/wpt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,16 @@ class WPTUpdater {
async updateVersions(updated) {
const versionsPath = this.versionsPath;
const readmePath = this.readmePath;
const versions = this.getLocalVersions();
let versions = this.getLocalVersions();

this.cli.startSpinner('Updating versions.json ...');
Object.assign(versions, updated);
// Reorder keys alphabetically
versions = Object.fromEntries(
Object.entries(versions).sort(([key1], [key2]) =>
key1.localeCompare(key2)
)
);
writeJson(versionsPath, versions);
this.cli.stopSpinner(`Updated ${versionsPath}`);

Expand Down

0 comments on commit 308982b

Please sign in to comment.