UNPKG

@chocolatemilkdev/emitter

Version:
23 lines (22 loc) 842 B
(function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define(["require", "exports"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function isAsyncFunction(val) { if (typeof val !== "function") return false; let valString = String(val); let valObjString = Object.prototype.toString.call(val); if (valString.includes("__awaiter") && valString.includes("function*")) return true; return valObjString === "[object AsyncFunction]"; } exports.default = isAsyncFunction; });