Add .asyncGenerator and .asyncGeneratorFunction detection (#100)

This commit is contained in:
Forresst 2020-01-29 18:35:58 +01:00 committed by GitHub
parent d28c86ee27
commit 446a7a081e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 89 additions and 2 deletions

View file

@ -132,6 +132,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.