source: node_modules/ramda-adjunct/es/isFinite.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: 1.0 KB
Line 
1import { bind, curryN } from 'ramda';
2import isFunction from './isFunction';
3import ponyfill from './internal/ponyfills/Number.isFinite';
4export var isFinitePonyfill = curryN(1, ponyfill);
5
6/**
7 * Checks whether the passed value is a finite `Number`.
8 *
9 * @func isFinite
10 * @memberOf RA
11 * @since {@link https://char0n.github.io/ramda-adjunct/0.7.0|v0.7.0}
12 * @category Type
13 * @sig * -> Boolean
14 * @param {*} val The value to test
15 * @return {boolean}
16 * @see {@link RA.isNotFinite|isNotFinite}
17 * @example
18 *
19 * RA.isFinite(Infinity); //=> false
20 * RA.isFinite(NaN); //=> false
21 * RA.isFinite(-Infinity); //=> false
22 *
23 * RA.isFinite(0); // true
24 * RA.isFinite(2e64); // true
25 *
26 * RA.isFinite('0'); // => false
27 * // would've been true with global isFinite('0')
28 * RA.isFinite(null); // => false
29 * // would've been true with global isFinite(null)
30 */
31var _isFinite = isFunction(Number.isFinite) ? curryN(1, bind(Number.isFinite, Number)) : isFinitePonyfill;
32export default _isFinite;
Note: See TracBrowser for help on using the repository browser.