Update docs and builds.

Former-commit-id: 21791e052114af5907d76251c58c3ba2ca138873
This commit is contained in:
John-David Dalton
2013-03-25 08:35:20 -07:00
parent 14343b5410
commit 87f1d55bc2
7 changed files with 240 additions and 261 deletions

View File

@@ -396,19 +396,6 @@
return htmlEscapes[match];
}
/**
* Checks if `value` is a DOM node in IE < 9.
*
* @private
* @param {Mixed} value The value to check.
* @returns {Boolean} Returns `true` if the `value` is a DOM node, else `false`.
*/
function isNode(value) {
// IE < 9 presents DOM nodes as `Object` objects except they have `toString`
// methods that are `typeof` "string" and still can coerce nodes to strings
return typeof value.toString != 'function' && typeof String(value) == 'string';
}
/**
* A fast path for creating `lodash` wrapper objects.
*
@@ -431,28 +418,6 @@
// no operation performed
}
/**
* A fallback implementation of `Object.keys` that produces an array of the
* given object's own enumerable property names.
*
* @private
* @type Function
* @param {Object} object The object to inspect.
* @returns {Array} Returns a new array of property names.
*/
var shimKeys = function (object) {
var index, iterable = object, result = [];
if (!iterable) return result;
if (!(objectTypes[typeof object])) return result;
for (index in iterable) {
if (hasOwnProperty.call(iterable, index)) {
result.push(index);
}
}
return result
};
/**
* Used by `unescape` to convert HTML entities to characters.
*
@@ -514,6 +479,28 @@
return (support.argsObject && value instanceof Array) || toString.call(value) == arrayClass;
};
/**
* A fallback implementation of `Object.keys` that produces an array of the
* given object's own enumerable property names.
*
* @private
* @type Function
* @param {Object} object The object to inspect.
* @returns {Array} Returns a new array of property names.
*/
var shimKeys = function (object) {
var index, iterable = object, result = [];
if (!iterable) return result;
if (!(objectTypes[typeof object])) return result;
for (index in iterable) {
if (hasOwnProperty.call(iterable, index)) {
result.push(index);
}
}
return result
};
/**
* Creates an array composed of the own enumerable property names of `object`.
*
@@ -2338,9 +2325,12 @@
* // => [2, 3, 4]
*/
function toArray(collection) {
if (collection && typeof collection.length == 'number') {
if (isArray(collection)) {
return slice.call(collection);
}
if (collection && typeof collection.length == 'number') {
return map(collection);
}
return values(collection);
}