Handle catching unknowns

This commit is contained in:
Misode
2021-09-09 22:34:22 +02:00
parent fd503f1d03
commit e3fb5923c0
4 changed files with 20 additions and 12 deletions

View File

@@ -67,3 +67,8 @@ export function lerp3(a: number, b: number, c: number, d: number, e: number, f:
export function smoothstep(x: number): number {
return x * x * x * (x * (x * 6 - 15) + 10)
}
export function message(e: unknown): string {
if (e instanceof Error) return e.message
return `${e}`
}