Checks if value is a AsyncGeneratorFunction, eg async function* () {}
When you call an AsyncGeneratorFunction, it returns an AsyncGenerator, that you can loop with for await (const x of asyncGenerator()) {}, or better yet for await (const [item] of z.loop(asyncGenerator())) {}
See
z.isAsyncGenerator() to check if a value is an AsyncGenerator, ie the result of calling an AsyncGeneratorFunction
Checks if value is a
AsyncGeneratorFunction
, egasync function* () {}
When you call an
AsyncGeneratorFunction
, it returns anAsyncGenerator
, that you can loop withfor await (const x of asyncGenerator()) {}
, or better yetfor await (const [item] of z.loop(asyncGenerator())) {}
See
z.isAsyncGenerator()
to check if a value is anAsyncGenerator
, ie the result of calling anAsyncGeneratorFunction
z.isGeneratorFunction
for the non-async check