mirror of
https://github.com/chenasraf/DefinitelyTyped.git
synced 2026-05-18 01:49:01 +00:00
fix(49492): restore alphabetical sort of packages (#52021)
Unwated artefact of #49492 was a change in the order of no longer needed pacakges from alphabetical sort to chronological (desc) This commit restores the alphabetical sort. Thanks! /cc @jablko @andrewbranch
This commit is contained in:
committed by
GitHub
parent
9136269c01
commit
78f0288bd8
@@ -1,3 +1,4 @@
|
||||
/// <reference lib="esnext"/>
|
||||
// Script to remove a package from DefinitelyTyped and add it to notNeededPackages.json
|
||||
|
||||
const fs = require("fs");
|
||||
@@ -13,8 +14,14 @@ if (process.argv.length !== 4 && process.argv.length !== 5) {
|
||||
}
|
||||
|
||||
rmdirRecursive(path.join("types", typingsPackageName));
|
||||
|
||||
/** @type {{packages: Record<string, { libraryName: string; asOfVersion: string; }> }} */
|
||||
const notNeededPackages = JSON.parse(fs.readFileSync("notNeededPackages.json", "utf-8"));
|
||||
notNeededPackages.packages[typingsPackageName] = { libraryName, asOfVersion };
|
||||
const sortedPackages = Object.entries(notNeededPackages.packages).sort((packageA, packageB) =>
|
||||
packageA[0].localeCompare(packageB[0]),
|
||||
);
|
||||
notNeededPackages.packages = Object.fromEntries(sortedPackages);
|
||||
fs.writeFileSync("notNeededPackages.json", JSON.stringify(notNeededPackages, undefined, 4) + "\n", "utf-8");
|
||||
|
||||
function rmdirRecursive(dir) {
|
||||
|
||||
Reference in New Issue
Block a user