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:
785 bytes
|
Line | |
---|
1 | import { 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 | */
|
---|
21 | const isAsyncFunction = curryN(1, pipe(type, identical('AsyncFunction')));
|
---|
22 |
|
---|
23 | export default isAsyncFunction;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.