This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
|
var toInteger = require('./_to-integer');
|
|
var max = Math.max;
|
|
var min = Math.min;
|
|
module.exports = function (index, length) {
|
|
index = toInteger(index);
|
|
return index < 0 ? max(index + length, 0) : min(index, length);
|
|
};
|