chushihua
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
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);
|
||||
};
|
||||
Reference in New Issue
Block a user