fix break

This commit is contained in:
nora 2023-07-30 21:04:29 +02:00
parent 0bf9aed35e
commit 1dad80f4c1
6 changed files with 70 additions and 33 deletions

View file

@ -1,3 +1,18 @@
export function encodeUtf8(s: string): Uint8Array {
return new TextEncoder().encode(s);
}
export class Ids {
nextId: number = 0;
public next(): number {
return this.nextId++;
}
}
export function unwrap<T>(value: T | undefined): T {
if (value === undefined) {
throw new Error("tried to unwrap undefined value");
}
return value;
}