Reduce lodash builds and cleanup README.md.

Former-commit-id: 3c6bbc236a35687c843a8cb27c29f71ed89d0ab0
This commit is contained in:
John-David Dalton
2012-10-04 18:15:45 -07:00
parent 6e9cbccde6
commit 4a6e17b214
5 changed files with 123 additions and 130 deletions

View File

@@ -531,13 +531,11 @@
if (isLarge) {
// init value cache
var key,
index = fromIndex - 1;
var index = fromIndex - 1;
while (++index < length) {
// manually coerce `value` to string because `hasOwnProperty`, in some
// older versions of Firefox, coerces objects incorrectly
key = array[index] + '';
var key = array[index] + '';
(hasOwnProperty.call(cache, key) ? cache[key] : (cache[key] = [])).push(array[index]);
}
}
@@ -666,11 +664,9 @@
* @private
* @param {Object} [options1, options2, ...] The compile options objects.
*
* useHas - A boolean to specify whether or not to use `hasOwnProperty` checks
* in the object loop.
* useHas - A boolean to specify using `hasOwnProperty` checks in the object loop.
*
* useStrict - A boolean to specify whether or not to include the ES5
* "use strict" directive.
* useStrict - A boolean to specify including the "use strict" directive.
*
* args - A string of comma separated arguments the iteration function will accept.
*
@@ -2502,13 +2498,12 @@
* // => [1, 2, 3, [[4]]];
*/
function flatten(array, shallow) {
var value,
index = -1,
var index = -1,
length = array ? array.length : 0,
result = [];
while (++index < length) {
value = array[index];
var value = array[index];
// recursively flatten arrays (susceptible to call stack limits)
if (isArray(value)) {
@@ -2703,15 +2698,14 @@
* // => { 'name': 'curly', 'age': 60 };
*/
function max(array, callback, thisArg) {
var current,
computed = -Infinity,
var computed = -Infinity,
index = -1,
length = array ? array.length : 0,
result = computed;
callback = createCallback(callback, thisArg);
while (++index < length) {
current = callback(array[index], index, array);
var current = callback(array[index], index, array);
if (current > computed) {
computed = current;
result = array[index];
@@ -2739,15 +2733,14 @@
* // => 2
*/
function min(array, callback, thisArg) {
var current,
computed = Infinity,
var computed = Infinity,
index = -1,
length = array ? array.length : 0,
result = computed;
callback = createCallback(callback, thisArg);
while (++index < length) {
current = callback(array[index], index, array);
var current = callback(array[index], index, array);
if (current < computed) {
computed = current;
result = array[index];
@@ -3737,7 +3730,7 @@
// http://ejohn.org/blog/javascript-micro-templating/
// and Laura Doktorova's doT.js
// https://github.com/olado/doT
text += '';
text || (text = '');
options || (options = {});
var isEvaluating,