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
Install size
4.52 kB
Created

Readme

Source

is-generator

Check whether a value is a generator or generator function.

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 04 May 2014

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