Skip to main content
Module

x/isx/mod.ts>isPromise

TypeScript-first is function collections
Go to Latest
function isPromise
import { isPromise } from "https://deno.land/x/isx@1.0.0-beta.24/mod.ts";

Whether the value is Promise or not.

Examples

Example 1

import { isPromise } from "https://deno.land/x/isx@$VERSION/mod.ts"
import { assertEquals } from "https://deno.land/std@$VERSION/testing/asserts.ts"
assertEquals(isPromise(Promise.resolve()), true)
assertEquals(isPromise({}), false)

Parameters

value: unknown
  • Any value.

Returns

value is Promise<T>