source: node_modules/ramda-adjunct/lib/sign.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.3 KB
Line 
1"use strict";
2
3exports.__esModule = true;
4exports.signPonyfill = exports["default"] = void 0;
5var _ramda = require("ramda");
6var _isFunction = _interopRequireDefault(require("./isFunction"));
7var _Math = _interopRequireDefault(require("./internal/ponyfills/Math.sign"));
8function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9var signPonyfill = (0, _ramda.curryN)(1, _Math["default"]);
10
11/**
12 * Returns the sign of a number, indicating whether the number is positive, negative or zero.
13 *
14 * @func sign
15 * @memberOf RA
16 * @since {@link https://char0n.github.io/ramda-adjunct/2.15.0|v2.15.0}
17 * @category Math
18 * @sig Number | String -> Number
19 * @param {number} number A number
20 * @return {number} A number representing the sign of the given argument. If the argument is a positive number, negative number, positive zero or negative zero, the function will return 1, -1, 0 or -0 respectively. Otherwise, NaN is returned
21 * @example
22 *
23 * RA.sign(3); // 1
24 * RA.sign(-3); // -1
25 * RA.sign('-3'); // -1
26 * RA.sign(0); // 0
27 * RA.sign(-0); // -0
28 * RA.sign(NaN); // NaN
29 * RA.sign('foo'); // NaN
30 */
31exports.signPonyfill = signPonyfill;
32var sign = (0, _isFunction["default"])(Math.sign) ? (0, _ramda.curryN)(1, (0, _ramda.bind)(Math.sign, Math)) : signPonyfill;
33var _default = sign;
34exports["default"] = _default;
Note: See TracBrowser for help on using the repository browser.