mirror of
https://github.com/nestriness/nestri.git
synced 2025-12-12 16:55:37 +02:00
We are hosting a [MoQ](https://quic.video) relay on a remote (bare metal) server on Hetzner With a lot of help from @victorpahuus
15 lines
280 B
TypeScript
15 lines
280 B
TypeScript
// I hate javascript
|
|
export function asError(e: any): Error {
|
|
if (e instanceof Error) {
|
|
return e
|
|
} else if (typeof e === "string") {
|
|
return new Error(e)
|
|
} else {
|
|
return new Error(String(e))
|
|
}
|
|
}
|
|
|
|
export function isError(e: any): e is Error {
|
|
return e instanceof Error
|
|
}
|