source: node_modules/ramda-adjunct/es/isFunction.js@ d24f17c

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

Initial commit

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