something is working

This commit is contained in:
quoije
2022-09-15 01:55:36 -04:00
parent a0aa251c27
commit f38e69883c
1123 changed files with 251731 additions and 11 deletions
+22
View File
@@ -0,0 +1,22 @@
'use strict';
let asyncFunctionPrototype = null;
// try/catch for Babel compatibility, because Babel preset-env requires
// regenerator-runtime for async/await and we don't want to include that
// for a simple check.
try {
asyncFunctionPrototype = Object.getPrototypeOf(async function() {});
} catch (err) {}
if (asyncFunctionPrototype == null) {
module.exports = function isAsyncFunction() {
return false;
};
} else {
module.exports = function isAsyncFunction(v) {
return (
typeof v === 'function' &&
Object.getPrototypeOf(v) === asyncFunctionPrototype
);
};
}