diff --git a/util.ts b/util.ts index fe979bd..5ffc571 100644 --- a/util.ts +++ b/util.ts @@ -23,4 +23,4 @@ export const error = (error: string) => ({ error }); export const ok = { result: null }; // deno-lint-ignore no-explicit-any -export const isKnownError = (e: any): e is T.KnownError => e.error || e["error-code"] \ No newline at end of file +export const isKnownError = (e: unknown): e is T.KnownError => e instanceof Object && ('error' in e || "error-code" in e) \ No newline at end of file