From 2c057a8c633492a16f0bb49411427d9a1cd084dd Mon Sep 17 00:00:00 2001 From: forresst Date: Fri, 27 Dec 2019 08:22:21 +0100 Subject: [PATCH] add docs for `.asyncGenerator` and `.asyncGeneratorFunction` --- readme.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/readme.md b/readme.md index bb744e7..72cbda2 100644 --- a/readme.md +++ b/readme.md @@ -116,6 +116,38 @@ is.asyncFunction(() => {}); // => false ``` +##### .asyncGenerator(value) + +```js +is.asyncGenerator( + (async function * () { + yield 4; + })() +); +// => true + +is.asyncGenerator( + (function * () { + yield 4; + })() +); +// => false +``` + +##### .asyncGeneratorFunction(value) + +```js +is.asyncGeneratorFunction(async function * () { + yield 4; +}); +// => true + +is.asyncGeneratorFunction(function * () { + yield 4; +}); +// => false +``` + ##### .boundFunction(value) Returns `true` for any `bound` function.