Add is.generator() and is.generatorFunction() (#4)

This commit is contained in:
Kunall Banerjee 2017-09-28 23:01:48 -04:00 committed by Sindre Sorhus
parent 000f66bbdc
commit dbe5cc8d82
3 changed files with 26 additions and 1 deletions

View file

@ -78,6 +78,12 @@ Keep in mind that [functions are objects too](https://developer.mozilla.org/en-U
Returns `true` for any object with a `.then()` and `.catch()` method. Prefer this one over `.nativePromise()` as you usually want to allow userland promise implementations too.
##### .generator(value)
Returns `true` for any object that implements its own `.next()` and `.throw()` methods and has a function definition for `Symbol.iterator`.
##### .generatorFunction(value)
##### .map(value)
##### .set(value)
##### .weakMap(value)