Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/tsafe/isPromiseLike.ts

🔩 The missing TypeScript utils
Go to Latest
File
// eslint-disable-next-line @typescript-eslint/no-explicit-anyexport function isPromiseLike<T = void>(o: any): o is PromiseLike<T> { return typeof o === "object" && o !== null && "then" in o && typeof o.then === "function";}