Bump to v4.14.2.

This commit is contained in:
John-David Dalton
2016-08-07 21:21:03 -07:00
parent 623a72a129
commit 3d3ce0979f
74 changed files with 421 additions and 440 deletions

35
_arrayLikeKeys.js Normal file
View File

@@ -0,0 +1,35 @@
define(['./_baseTimes', './isArguments', './isArray', './_isIndex', './isString'], function(baseTimes, isArguments, isArray, isIndex, isString) {
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Creates an array of the enumerable property names of the array-like `value`.
*
* @private
* @param {*} value The value to query.
* @param {boolean} inherited Specify returning inherited property names.
* @returns {Array} Returns the array of property names.
*/
function arrayLikeKeys(value, inherited) {
var result = (isArray(value) || isString(value) || isArguments(value))
? baseTimes(value.length, String)
: [];
var length = result.length,
skipIndexes = !!length;
for (var key in value) {
if ((inherited || hasOwnProperty.call(value, key)) &&
!(skipIndexes && (key == 'length' || isIndex(key, length)))) {
result.push(key);
}
}
return result;
}
return arrayLikeKeys;
});