JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 552040
  • Score
    100M100P100Q171679F
  • License MIT

Check whether a value is a generator or generator function

Package Exports

  • is-generator

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Is Generator

NPM version NPM downloads Build status Test coverage

Check whether a value is a generator or generator function.

Generator: A specific type of iterator object. Reference. Generator Function: A function* declaration, returns a generator object. Reference.

Installation

npm install is-generator --save

Usage

var isGenerator = require('is-generator')
var isGeneratorFn = require('is-generator').fn

isGenerator(null) //=> false
isGenerator(function * () {}) //=> false
isGenerator((function * () {})()) //=> true

isGeneratorFn(null) //=> false
isGeneratorFn(function () {}) //=> false
isGeneratorFn(function * () {}) //=> true

License

MIT