source: node_modules/ramda-adjunct/src/isAsyncFunction.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 785 bytes
Line 
1import { pipe, type, identical, curryN } from 'ramda';
2
3/**
4 * Checks if input value is `Async Function`.
5 *
6 * @func isAsyncFunction
7 * @memberOf RA
8 * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
9 * @category Type
10 * @sig * -> Boolean
11 * @param {*} val The value to test
12 * @return {boolean}
13 * @see {@link RA.isFunction|isFunction}, {@link RA.isNotAsyncFunction|isNotAsyncFunction}, {@link RA.isGeneratorFunction|isGeneratorFunction}
14 * @example
15 *
16 * RA.isAsyncFunction(async function test() { }); //=> true
17 * RA.isAsyncFunction(null); //=> false
18 * RA.isAsyncFunction(function test() { }); //=> false
19 * RA.isAsyncFunction(() => {}); //=> false
20 */
21const isAsyncFunction = curryN(1, pipe(type, identical('AsyncFunction')));
22
23export default isAsyncFunction;
Note: See TracBrowser for help on using the repository browser.