source: node_modules/ramda-adjunct/es/isNaN.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: 1.2 KB
Line 
1import { curryN } from 'ramda';
2import isFunction from './isFunction';
3import ponyfill from './internal/ponyfills/Number.isNaN';
4export var isNaNPonyfill = curryN(1, ponyfill);
5
6/**
7 * Checks whether the passed value is `NaN` and its type is `Number`.
8 * It is a more robust version of the original, global isNaN().
9 *
10 *
11 * @func isNaN
12 * @memberOf RA
13 * @since {@link https://char0n.github.io/ramda-adjunct/0.6.0|v0.6.0}
14 * @category Type
15 * @sig * -> Boolean
16 * @param {*} val The value to test
17 * @return {boolean}
18 * @see {@link RA.isNotNaN|isNotNaN}
19 * @example
20 *
21 * RA.isNaN(NaN); // => true
22 * RA.isNaN(Number.NaN); // => true
23 * RA.isNaN(0 / 0); // => true
24 *
25 * // e.g. these would have been true with global isNaN().
26 * RA.isNaN('NaN'); // => false
27 * RA.isNaN(undefined); // => false
28 * RA.isNaN({}); // => false
29 * RA.isNaN('blabla'); // => false
30 *
31 * RA.isNaN(true); // => false
32 * RA.isNaN(null); // => false
33 * RA.isNaN(37); // => false
34 * RA.isNaN('37'); // => false
35 * RA.isNaN('37.37'); // => false
36 * RA.isNaN(''); // => false
37 * RA.isNaN(' '); // => false
38 */
39var _isNaN = isFunction(Number.isNaN) ? curryN(1, Number.isNaN) : isNaNPonyfill;
40export default _isNaN;
Note: See TracBrowser for help on using the repository browser.