Update util.ts

Co-authored-by: J M <2364004+Blu-J@users.noreply.github.com>
This commit is contained in:
Lucy C
2022-11-15 12:36:59 -05:00
committed by GitHub
parent bfa30da1f6
commit a3f47810ee

View File

@@ -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"]
export const isKnownError = (e: unknown): e is T.KnownError => e instanceof Object && ('error' in e || "error-code" in e)