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:
624 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | import { curryN, pipe, type, identical } from 'ramda';
|
---|
| 2 |
|
---|
| 3 | import isFunction from './isFunction';
|
---|
| 4 |
|
---|
| 5 | /**
|
---|
| 6 | * Checks if input value is `Array`.
|
---|
| 7 | *
|
---|
| 8 | * @func isArray
|
---|
| 9 | * @memberOf RA
|
---|
| 10 | * @since {@link https://char0n.github.io/ramda-adjunct/0.3.0|v0.3.0}
|
---|
| 11 | * @category Type
|
---|
| 12 | * @sig * -> Boolean
|
---|
| 13 | * @param {*} val The value to test
|
---|
| 14 | * @return {boolean}
|
---|
| 15 | * @see {@link RA.isNotArray|isNotArray}
|
---|
| 16 | * @example
|
---|
| 17 | *
|
---|
| 18 | * RA.isArray([]); //=> true
|
---|
| 19 | * RA.isArray(null); //=> false
|
---|
| 20 | * RA.isArray({}); //=> false
|
---|
| 21 | */
|
---|
| 22 | const isArray = curryN(
|
---|
| 23 | 1,
|
---|
| 24 | isFunction(Array.isArray) ? Array.isArray : pipe(type, identical('Array'))
|
---|
| 25 | );
|
---|
| 26 |
|
---|
| 27 | export default isArray;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.