mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +00:00
Remove semicolons.
This commit is contained in:
18
toLength.js
18
toLength.js
@@ -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 the maximum length and index of an array. */
|
||||
const MAX_ARRAY_LENGTH = 4294967295;
|
||||
const MAX_ARRAY_LENGTH = 4294967295
|
||||
|
||||
/**
|
||||
* Converts `value` to an integer suitable for use as the length of an
|
||||
@@ -17,20 +17,20 @@ const MAX_ARRAY_LENGTH = 4294967295;
|
||||
* @returns {number} Returns the converted integer.
|
||||
* @example
|
||||
*
|
||||
* toLength(3.2);
|
||||
* toLength(3.2)
|
||||
* // => 3
|
||||
*
|
||||
* toLength(Number.MIN_VALUE);
|
||||
* toLength(Number.MIN_VALUE)
|
||||
* // => 0
|
||||
*
|
||||
* toLength(Infinity);
|
||||
* toLength(Infinity)
|
||||
* // => 4294967295
|
||||
*
|
||||
* toLength('3.2');
|
||||
* toLength('3.2')
|
||||
* // => 3
|
||||
*/
|
||||
function toLength(value) {
|
||||
return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
|
||||
return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0
|
||||
}
|
||||
|
||||
export default toLength;
|
||||
export default toLength
|
||||
|
||||
Reference in New Issue
Block a user