Config default templates

This commit is contained in:
space-nuko
2023-05-25 17:38:30 -05:00
parent 2a0662592a
commit 220be38a0b
6 changed files with 89 additions and 35 deletions

View File

@@ -598,3 +598,13 @@ export function calcNodesBoundingBox(nodes: SerializedLGraphNode[]): Vector4 {
return [min_x, min_y, max_x, max_y];
}
export async function readFileToText(file: File): Promise<string> {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onload = async () => {
resolve(reader.result as string);
};
reader.readAsText(file);
})
}