Skip to content

Commit

Permalink
Improve accuracy of the isAsync type guard (colinhacks#1719)
Browse files Browse the repository at this point in the history
* Fix isAsync type guard

* Remove unexpected README change
  • Loading branch information
aaronccasanova authored Dec 24, 2022
1 parent 907c7e6 commit a48f366
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deno/lib/helpers/parseUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,4 @@ export const isValid = <T>(x: ParseReturnType<T>): x is OK<T> | DIRTY<T> =>
export const isAsync = <T>(
x: ParseReturnType<T>
): x is AsyncParseReturnType<T> =>
typeof Promise !== undefined && x instanceof Promise;
typeof Promise !== "undefined" && x instanceof Promise;
2 changes: 1 addition & 1 deletion src/helpers/parseUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,4 @@ export const isValid = <T>(x: ParseReturnType<T>): x is OK<T> | DIRTY<T> =>
export const isAsync = <T>(
x: ParseReturnType<T>
): x is AsyncParseReturnType<T> =>
typeof Promise !== undefined && x instanceof Promise;
typeof Promise !== "undefined" && x instanceof Promise;

0 comments on commit a48f366

Please sign in to comment.