Skip to content

Commit fa8aab0

Browse files
committed
fix(wpt): order version keys alphabetically (#536)
1 parent 50c02d5 commit fa8aab0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/wpt/index.js

Lines changed: 7 additions & 1 deletion
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)