2311061106/frontend/node_modules/generator-function
23175 b8b09fd9d4
Some checks failed
autograde-final-vibevault / check-trigger (push) Successful in 13s
autograde-final-vibevault / grade (push) Failing after 55s
完成作业
2025-12-14 16:02:40 +08:00
..
.github 完成作业 2025-12-14 16:02:40 +08:00
test 完成作业 2025-12-14 16:02:40 +08:00
.eslintrc 完成作业 2025-12-14 16:02:40 +08:00
.nycrc 完成作业 2025-12-14 16:02:40 +08:00
CHANGELOG.md 完成作业 2025-12-14 16:02:40 +08:00
index.d.mts 完成作业 2025-12-14 16:02:40 +08:00
index.d.ts 完成作业 2025-12-14 16:02:40 +08:00
index.js 完成作业 2025-12-14 16:02:40 +08:00
index.mjs 完成作业 2025-12-14 16:02:40 +08:00
legacy.js 完成作业 2025-12-14 16:02:40 +08:00
LICENSE.md 完成作业 2025-12-14 16:02:40 +08:00
package.json 完成作业 2025-12-14 16:02:40 +08:00
README.md 完成作业 2025-12-14 16:02:40 +08:00
require.mjs 完成作业 2025-12-14 16:02:40 +08:00
tsconfig.json 完成作业 2025-12-14 16:02:40 +08:00

generator-function Version Badge

github actions coverage License Downloads

npm badge

A function that returns the normally hidden GeneratorFunction constructor, when available.

Getting started

npm install --save generator-function

Usage/Examples

const assert = require('assert');
const GeneratorFunction = require('generator-function')();

const fn = new GeneratorFunction('return 1');

assert.equal(fn.toString(), 'function* anonymous(\n) {\nreturn 1\n}');

const iterator = fn();

assert.deepEqual(iterator.next(), { done: true, value: 1 });

Tests

Clone the repo, npm install, and run npm test