wallet-core/node_modules/is-generator-fn/index.js

12 lines
275 B
JavaScript
Raw Normal View History

2017-05-28 00:38:50 +02: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]';
};