Skip to content

Commit 308982b

Browse files
authored
fix(wpt): order version keys alphabetically (nodejs#536)
1 parent d6fad2a commit 308982b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/wpt/index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,16 @@ class WPTUpdater {
9494
async updateVersions(updated) {
9595
const versionsPath = this.versionsPath;
9696
const readmePath = this.readmePath;
97-
const versions = this.getLocalVersions();
97+
let versions = this.getLocalVersions();
9898

9999
this.cli.startSpinner('Updating versions.json ...');
100100
Object.assign(versions, updated);
101+
// Reorder keys alphabetically
102+
versions = Object.fromEntries(
103+
Object.entries(versions).sort(([key1], [key2]) =>
104+
key1.localeCompare(key2)
105+
)
106+
);
101107
writeJson(versionsPath, versions);
102108
this.cli.stopSpinner(`Updated ${versionsPath}`);
103109

0 commit comments

Comments
 (0)