Node util/types.isGeneratorObject function | API Reference | Bun
BuildDocsReferenceGuidesBlogDiscord/
node:util/types/
isGeneratorObjectFisGeneratorObject
Search the reference...
/
BuildDocsReferenceGuidesBlogDiscord/
node:util/types/
isGeneratorObjectFisGeneratorObject
function
util.types.isGeneratorObjectfunction
isGeneratorObject(object: unknown): object is Generatorunknown, any, any>;
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.
function* foo() {}
const generator = foo();
util.types.isGeneratorObject(generator); // Returns true
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlog Toolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →