We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 578d45f commit bcf9a87Copy full SHA for bcf9a87
src/lib.ts
@@ -564,3 +564,8 @@ export function coerceError(err: unknown): Error & { code?: unknown } {
564
return new Error(message, { cause: err });
565
}
566
567
+
568
+export function isPromiseLike<T>(v: PromiseLike<T> | T): v is PromiseLike<T> {
569
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
570
+ return v != null && typeof (v as any).then === "function";
571
+}
0 commit comments