Skip to main content
Module

x/isx/mod.ts>isAsyncGenerator

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

Whether the value is AsyncGenerator or not.

Type Parameters

optional
T = unknown
optional
TReturn = unknown
optional
TNext = unknown

Parameters

value: unknown
  • Any value.
import { isAsyncGenerator } from "https://deno.land/x/isx@$VERSION/mod.ts"
import { assertEquals } from "https://deno.land/std@$VERSION/testing/asserts.ts"
async function* asyncGenerator() {}
assertEquals(
isAsyncGenerator(asyncGenerator()),
true,
);
assertEquals(isAsyncGenerator({async [Symbol.asyncIterator]() {}}), false);

Returns

value is AsyncGenerator<T, TReturn, TNext>