Files
start-os/sdk/base/lib/util/asError.ts
Aiden McClelland 855c1f1b07 style(sdk): apply prettier with single quotes
Run prettier across sdk/base and sdk/package to apply the
standardized quote style (single quotes matching web).
2026-02-05 13:34:01 -07:00

10 lines
213 B
TypeScript

export const asError = (e: unknown) => {
if (e instanceof Error) {
return new Error(e as any)
}
if (typeof e === 'string') {
return new Error(`${e}`)
}
return new Error(`${JSON.stringify(e)}`)
}