Very Popular
/** * Check if the content variable is a generator. */export function isGenerator( content: unknown,): content is GeneratorFunction | AsyncGeneratorFunction { if (typeof content !== "function") { return false; }
const name = content.constructor.name; return (name === "GeneratorFunction" || name === "AsyncGeneratorFunction");}