Fix widget autoconfig

This commit is contained in:
space-nuko
2023-05-06 20:48:27 -05:00
parent a0bbdfe7c4
commit 92ae379ee9
2 changed files with 8 additions and 2 deletions

View File

@@ -11,6 +11,10 @@ export function clamp(n: number, min: number, max: number): number {
return Math.min(Math.max(n, min), max)
}
export function range(size: number, startAt: number = 0): ReadonlyArray<number> {
return [...Array(size).keys()].map(i => i + startAt);
}
export function download(filename: string, text: string, type: string = "text/plain") {
const blob = new Blob([text], { type: type });
const url = URL.createObjectURL(blob);