mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
Remove semicolons.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import baseClamp from './.internal/baseClamp.js';
|
||||
import toInteger from './toInteger.js';
|
||||
import baseClamp from './.internal/baseClamp.js'
|
||||
import toInteger from './toInteger.js'
|
||||
|
||||
/** Used as references for various `Number` constants. */
|
||||
const MAX_SAFE_INTEGER = 9007199254740991;
|
||||
const MAX_SAFE_INTEGER = 9007199254740991
|
||||
|
||||
/**
|
||||
* Converts `value` to a safe integer. A safe integer can be compared and
|
||||
@@ -14,22 +14,22 @@ const MAX_SAFE_INTEGER = 9007199254740991;
|
||||
* @returns {number} Returns the converted integer.
|
||||
* @example
|
||||
*
|
||||
* toSafeInteger(3.2);
|
||||
* toSafeInteger(3.2)
|
||||
* // => 3
|
||||
*
|
||||
* toSafeInteger(Number.MIN_VALUE);
|
||||
* toSafeInteger(Number.MIN_VALUE)
|
||||
* // => 0
|
||||
*
|
||||
* toSafeInteger(Infinity);
|
||||
* toSafeInteger(Infinity)
|
||||
* // => 9007199254740991
|
||||
*
|
||||
* toSafeInteger('3.2');
|
||||
* toSafeInteger('3.2')
|
||||
* // => 3
|
||||
*/
|
||||
function toSafeInteger(value) {
|
||||
return value
|
||||
? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
|
||||
: (value === 0 ? value : 0);
|
||||
: (value === 0 ? value : 0)
|
||||
}
|
||||
|
||||
export default toSafeInteger;
|
||||
export default toSafeInteger
|
||||
|
||||
Reference in New Issue
Block a user