forked from orbit-oss/is
Add .asyncGenerator and .asyncGeneratorFunction detection (#100)
This commit is contained in:
parent
d28c86ee27
commit
446a7a081e
3 changed files with 89 additions and 2 deletions
32
readme.md
32
readme.md
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue