Files

12 lines
275 B
JavaScript
Raw Permalink Normal View History

2024-12-03 17:40:13 +08:00
'use strict';
var toString = Object.prototype.toString;
module.exports = function (fn) {
if (typeof fn !== 'function') {
return false;
}
return (fn.constructor && fn.constructor.name === 'GeneratorFunction') ||
toString.call(fn) === '[object GeneratorFunction]';
};