Clone this repo:

Branches

  1. 496fab7 Fixing a bug in index.js by Kian Jamali · 2 years ago main
  2. dab259f [nwd] Fixed the trustedTypes variable identification bug by Kian Jamali · 2 years ago
  3. 3473491 Updating index.js to patch the TT violation using the Function workaround by Kian Jamali · 2 years ago
  4. 8339768 Trusted types patch for is-generator-function by Kian Jamali · 2 years, 3 months ago
  5. 474ced3 Initial import of is-generator-function by Kian Jamali · 2 years, 3 months ago

is-generator-function Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this a native generator function?

Example

var isGeneratorFunction = require('is-generator-function');
assert(!isGeneratorFunction(function () {}));
assert(!isGeneratorFunction(null));
assert(isGeneratorFunction(function* () { yield 42; return Infinity; }));

Tests

Simply clone the repo, npm install, and run npm test