feat: build reproducible dataset editor

This commit is contained in:
Codex
2026-08-28 10:46:33 +09:00
parent 6a1197d60e
commit 08fcf578de
16 changed files with 2579 additions and 11 deletions
+14
View File
@@ -17,6 +17,20 @@ export function downloadJson(value, fileName) {
setTimeout(() => URL.revokeObjectURL(url), 0);
}
export function downloadBlob(blob, fileName) {
const url = URL.createObjectURL(blob);
const anchor = document.createElement("a");
anchor.href = url;
anchor.download = fileName;
anchor.click();
setTimeout(() => URL.revokeObjectURL(url), 0);
}
export async function sha256File(file) {
const digest = await crypto.subtle.digest("SHA-256", await file.arrayBuffer());
return [...new Uint8Array(digest)].map((value) => value.toString(16).padStart(2, "0")).join("");
}
export function deepClone(value) {
return structuredClone(value);
}