ts-quiz— ~/quiz/levels.ts
tsc --watch● loading…
// tsc --watch · type-checking modules…
await load("quiz/levels.ts")
// streaming server components
◇ tsc 6.0.3 · compiling…UTF-8◇ scanning levels…
assertNever function?function assertNever(value: never): never {
throw new Error(`Unexpected value: ${value}`);
}
type Shape = "circle" | "square";
function area(shape: Shape) {
switch (shape) {
case "circle": return Math.PI;
case "square": return 1;
default: return assertNever(shape);
}
}