Skip to main content
Module

x/unitest/deps.ts>isPromise

🃏 Deno-first universal unit testing framework
Latest
function isPromise
import { isPromise } from "https://deno.land/x/unitest@v1.0.0-beta.82/deps.ts";

Whatever argument is Promise or not

Examples

Example 1

import { isPromise } from './mod.ts'
isPromise(Promise.resolve()) // true
isPromise({}) // false

Type Parameters

optional
T = unknown

Parameters

value: unknown
  • Input any value

Returns

value is Promise<T>

The result of value instanceof Promise