UNPKG

xcraft-core-utils

Version:
17 lines (12 loc) 388 B
'use strict'; const AsyncFunction = (async () => {}).constructor; const GeneratorFunction = function* () {}.constructor; exports.isFunction = function (fn) { return typeof fn === 'function'; }; exports.isGenerator = function (fn) { return fn && fn instanceof GeneratorFunction === true; }; exports.isAsync = function (fn) { return fn && fn instanceof AsyncFunction === true; };