Skip to content

Commit

Permalink
fix: safer isPromise
Browse files Browse the repository at this point in the history
  • Loading branch information
schummar committed Feb 29, 2024
1 parent 14bc93c commit 8df71e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ export function calcLocales(
}

export function isPromise(x: unknown): x is Promise<unknown> {
return typeof x === 'object' && x !== null && 'then' in x;
return typeof x === 'object' && x !== null && 'then' in x && typeof x.then === 'function';
}

0 comments on commit 8df71e3

Please sign in to comment.