@qntm-code/utils
Version:
A collection of useful utility functions with associated TypeScript types. All functions have been unit tested.
8 lines (7 loc) • 309 B
JavaScript
/**
* Determines whether the given value is a generator object.
*/
export function isGeneratorObject(value) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
return typeof value.throw === 'function' && typeof value.return === 'function' && typeof value.next === 'function';
}