• value {any}
    • Returns: {boolean}

    Returns true if the value is a generator object as returned from a built-in generator function. This only reports back what the JavaScript engine is seeing; in particular, the return value may not match the original source code if a transpilation tool was used.

    1. function* foo() {}
    2. const generator = foo();
    3. util.types.isGeneratorObject(generator); // Returns true