This repository has been archived on 2026-04-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
AsaJS/scripts/paths-optimize.ts
2026-02-22 16:04:31 +07:00

16 lines
466 B
TypeScript

import { writeFileSync } from "fs"
import { paths } from "../src/types/vanilla/paths"
const newPaths: Record<string, any> = {}
Object.entries(paths).forEach(([key, values]) => {
const paths = Array.from(new Set(Object.values(values)))
console.log(key)
if (paths.length === 1) {
newPaths[key] = paths[0]
} else {
newPaths[key] = values
}
})
writeFileSync("src/types/vanilla/paths.ts", `export const paths = ${JSON.stringify(newPaths, null, 4)}`, "utf-8")