source: imaps-frontend/node_modules/es-abstract/2022/ToLength.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 362 bytes
Line 
1'use strict';
2
3var MAX_SAFE_INTEGER = require('../helpers/maxSafeInteger');
4
5var ToIntegerOrInfinity = require('./ToIntegerOrInfinity');
6
7module.exports = function ToLength(argument) {
8 var len = ToIntegerOrInfinity(argument);
9 if (len <= 0) { return 0; } // includes converting -0 to +0
10 if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }
11 return len;
12};
Note: See TracBrowser for help on using the repository browser.