mirror of
https://github.com/actions/setup-node.git
synced 2025-06-29 06:03:50 +00:00
.
This commit is contained in:
parent
8affe1ed56
commit
760046e9f2
7278 changed files with 0 additions and 1778943 deletions
37
node_modules/lodash/toSafeInteger.js
generated
vendored
37
node_modules/lodash/toSafeInteger.js
generated
vendored
|
@ -1,37 +0,0 @@
|
|||
var baseClamp = require('./_baseClamp'),
|
||||
toInteger = require('./toInteger');
|
||||
|
||||
/** Used as references for various `Number` constants. */
|
||||
var MAX_SAFE_INTEGER = 9007199254740991;
|
||||
|
||||
/**
|
||||
* Converts `value` to a safe integer. A safe integer can be compared and
|
||||
* represented correctly.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to convert.
|
||||
* @returns {number} Returns the converted integer.
|
||||
* @example
|
||||
*
|
||||
* _.toSafeInteger(3.2);
|
||||
* // => 3
|
||||
*
|
||||
* _.toSafeInteger(Number.MIN_VALUE);
|
||||
* // => 0
|
||||
*
|
||||
* _.toSafeInteger(Infinity);
|
||||
* // => 9007199254740991
|
||||
*
|
||||
* _.toSafeInteger('3.2');
|
||||
* // => 3
|
||||
*/
|
||||
function toSafeInteger(value) {
|
||||
return value
|
||||
? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
|
||||
: (value === 0 ? value : 0);
|
||||
}
|
||||
|
||||
module.exports = toSafeInteger;
|
Loading…
Add table
Add a link
Reference in a new issue