UNPKG

foop

Version:

interfaces that describe their intentions.

28 lines (26 loc) 463 B
const toS = require('./toS') /** * @category Lang * * @param {*} x value * @return {boolean} isAsync * @since 4.0.0-beta.2 * * @memberOf is * @func isAsync * @see is/toS * @see is/promise * * @example * * isAsync(async function() {}) * //=> true * isAsync(new Promise(r => r())) * //=> false * isAsync({}) * //=> false * isAsync(function() {}) */ module.exports = function isAsync(x) { return toS(x) === '[object AsyncFunction]' }