mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-09-04 14:39:28 +00:00
Use JSON + a typed wrapper instead of TS codegen (#1025)
Signed-off-by: William Woodruff <william@yossarian.net>
This commit is contained in:
+5164
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -19,16 +19,7 @@ export async function updateChecksums(
|
||||
deduplicatedEntries.set(entry.key, entry.checksum);
|
||||
}
|
||||
|
||||
const body = [...deduplicatedEntries.entries()]
|
||||
.map(([key, checksum]) => ` "${key}":\n "${checksum}"`)
|
||||
.join(",\n");
|
||||
|
||||
const content =
|
||||
"// AUTOGENERATED_DO_NOT_EDIT\n" +
|
||||
"export const KNOWN_CHECKSUMS: { [key: string]: string } = {\n" +
|
||||
body +
|
||||
(body === "" ? "" : ",\n") +
|
||||
"};\n";
|
||||
const content = `${JSON.stringify(Object.fromEntries(deduplicatedEntries), null, 2)}\n`;
|
||||
|
||||
await fs.writeFile(filePath, content);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user