From 74fc15cccdfdb4fb66979b2ae9f7591ff4ca96d2 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 15 Jan 2015 21:54:14 -0800 Subject: [PATCH] Move `isIndex` into `runInContext`. --- lodash.src.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index 05bbc0439..a24a90e3d 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -515,20 +515,6 @@ }; }()); - /** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - value = +value; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; - } - /** * Checks if `value` is object-like. * @@ -3733,6 +3719,20 @@ return result; } + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + value = +value; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; + } + /** * Checks if the provided arguments are from an iteratee call. *