UNPKG

ramda-extension

Version:

Helpful functions built on top of the mighty Ramda

20 lines (19 loc) 451 B
import { allPass, o, prop } from 'ramda'; import isFunction from './isFunction'; import isObject from './isObject'; /** * Returns true if argument is Promise. * * @func * @category Type * * @example * * R_.isPromise(Promise.resolve()) // true * R_.isPromise(0) // false * * @sig a -> Boolean * */ var isPromise = /*#__PURE__*/allPass([isObject, /*#__PURE__*/o(isFunction, /*#__PURE__*/prop('then'))]); export default isPromise;