isAsyncFunction.js 203 B

1234567891011
  1. 'use strict';
  2. const { inspect } = require('util');
  3. module.exports = function isAsyncFunction(v) {
  4. if (typeof v !== 'function') {
  5. return;
  6. }
  7. return inspect(v).startsWith('[AsyncFunction:');
  8. };