Socket
Socket
Sign inDemoInstall

is-generator

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-generator

Check whether a value is a generator or generator function


Version published
Maintainers
1
Weekly downloads
601,193
decreased by-6.61%

Weekly downloads

Readme

Source

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

Keywords

FAQs

Last updated on 29 Mar 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc