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:
644 bytes
|
Line | |
---|
1 | import { curryN, pipe, type, identical } from 'ramda';
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * Checks if value is a `Number` primitive or object.
|
---|
5 | *
|
---|
6 | * @func isNumber
|
---|
7 | * @memberOf RA
|
---|
8 | * @since {@link https://char0n.github.io/ramda-adjunct/0.6.0|v0.6.0}
|
---|
9 | * @category Type
|
---|
10 | * @sig * -> Boolean
|
---|
11 | * @param {*} val The value to test
|
---|
12 | * @return {boolean}
|
---|
13 | * @see {@link RA.isNotNumber|isNotNumber}
|
---|
14 | * @example
|
---|
15 | *
|
---|
16 | * RA.isNumber(5); // => true
|
---|
17 | * RA.isNumber(Number.MAX_VALUE); // => true
|
---|
18 | * RA.isNumber(-Infinity); // => true
|
---|
19 | * RA.isNumber(NaN); // => true
|
---|
20 | * RA.isNumber('5'); // => false
|
---|
21 | */
|
---|
22 | const isNumber = curryN(1, pipe(type, identical('Number')));
|
---|
23 |
|
---|
24 | export default isNumber;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.