diff --git a/README.md b/README.md
index 320ee8240..fb1c306c0 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,12 @@
# Lo-Dash v0.1.0
-A drop-in replacement for [Underscore.js](https://github.com/documentcloud/underscore/) that delivers up to [8x performance improvements](http://jsperf.com/lodash-underscore#chart=bar), [bug fixes](https://github.com/bestiejs/lodash/blob/master/test/test.js#L88), and additional features.
+Lo-Dash, from the devs behind [jsPerf.com](http://jsperf.com), is a drop-in replacement for Underscore.js that delivers [performance improvements](http://jsperf.com/lodash-underscore#filterby=family), [additional features](https://github.com/bestiejs/lodash/wiki/The-Low-Down#wiki-features), and works on nearly all JavaScript platforms1.
-## Screencast
+## Screencasts
-For more information check out [this screencast](http://dl.dropbox.com/u/513327/allyoucanleet/post/20/file/screencast.mp4) over Lo-Dash.
+For more information check out the series of screencasts over Lo-Dash:
+ * [Introducing Lo-Dash](http://dl.dropbox.com/u/513327/allyoucanleet/post/20/file/screencast.mp4)
+ * [Compiling and custom builds]()
## BestieJS
@@ -12,7 +14,7 @@ Lo-Dash is part of the BestieJS *"Best in Class"* module collection. This means
## Documentation
-The documentation for Lo-Dash can be viewed here: [/doc/README.md](https://github.com/bestiejs/lodash/blob/master/doc/README.md#readme)
+The documentation for Lo-Dash can be viewed here:
Underscore's [documentation](http://documentcloud.github.com/underscore/) may also be used.
@@ -20,11 +22,32 @@ For a list of upcoming features, check out our [roadmap](https://github.com/best
## So What's The Secret?
-Lo-Dash's performance is gained by avoiding native methods, instead opting for simplified non-ES5 compliant methods optimized for common usage, and by leveraging function compilation to reduce the number of overall function calls.
+Lo-Dash's performance is gained by avoiding slower native methods, instead opting for simplified non-ES5 compliant methods optimized for common usage, and by leveraging function compilation to reduce the number of overall function calls.
-## What else?
+## Any New Features?
-Lo-Dash comes with AMD loader support baked in, chainable `_.each`, and will [soon address](https://github.com/bestiejs/lodash/wiki/Roadmap) cross-browser object iteration issues.
+Lo-Dash comes with AMD loader support, chainable `_.each`, lazy `_.bind`, [and more](https://github.com/bestiejs/lodash/wiki/The-Low-Down#wiki-features)...
+
+## Custom builds
+
+Creating custom builds to keep your utility belt lightweight is easy.
+We handle all the method dependency and alias mapping for you.
+
+Custom builds may be created in two ways:
+
+ 1. Use the`include` argument to pass the names of the methods to include in the build.
+~~~ bash
+node build include=each,filter,map,noConflict
+node build include="each, filter, map, noConflict"
+~~~
+
+ 2. Use the `exclude` argument to pass the names of the methods to exclude from the build.
+~~~ bash
+node build exclude=isNaN,union,zip
+node build exclude="isNaN, union, zip"
+~~~
+
+Custom builds are saved to `lodash.custom.js` and `lodash.custom.min.js`.
## Installation and usage
@@ -92,6 +115,11 @@ git submodule update --init
Feel free to fork and send pull requests if you see improvements!
+## Footnotes
+
+ 1. Lo-Dash has been tested in at least Chrome 5-19, Firefox 1.5-12, IE 6-9, Opera 9.25-11.64, Safari 3.0.4-5.1.3, Node.js 0.4.8-0.6.18, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC3.
+ ↩
+
## Author
* [John-David Dalton](http://allyoucanleet.com/)
diff --git a/lodash.js b/lodash.js
index 7c5909153..825cb7b58 100644
--- a/lodash.js
+++ b/lodash.js
@@ -635,11 +635,11 @@
* @returns {Array|Object} Returns the `collection`.
* @example
*
- * _.forEach([1, 2, 3], function(num) { alert(num); });
- * // => alerts each number in turn...
+ * _([1, 2, 3]).forEach(function(num) { alert(num); }).join(',');
+ * // => alerts each number in turn and returns "1,2,3"
*
* _.forEach({ 'one': 1, 'two': 2, 'three': 3}, function(num) { alert(num); });
- * // => alerts each number in turn...
+ * // => alerts each number in turn
*/
var forEach = createIterator(baseIteratorOptions, {
'top': 'if (thisArg) callback = bind(callback, thisArg)'
@@ -851,7 +851,7 @@
});
/**
- * Gets the number of values in the `collection`.
+ * Gets the number of values in the `collection` or the `length` of a string value.
*
* @static
* @memberOf _
@@ -860,8 +860,14 @@
* @returns {Number} Returns the number of values in the collection.
* @example
*
+ * _.size([1, 2]);
+ * // => 2
+ *
* _.size({ 'one': 1, 'two': 2, 'three': 3 });
* // => 3
+ *
+ * _.size('curly');
+ * // => 5
*/
function size(collection) {
var className = toString.call(collection);
@@ -889,6 +895,9 @@
*
* _.sortBy([1, 2, 3, 4, 5, 6], function(num) { return Math.sin(num); });
* // => [5, 4, 6, 3, 1, 2]
+ *
+ * _.sortBy([1, 2, 3, 4, 5, 6], function(num) { return this.sin(num); }, Math);
+ * // => [5, 4, 6, 3, 1, 2]
*/
function sortBy(collection, callback, thisArg) {
if (toString.call(callback) != funcClass) {
@@ -1828,7 +1837,8 @@
* Creates a new function that will delay the execution of `func` until after
* `wait` milliseconds have elapsed since the last time it was invoked. Pass
* `true` for `immediate` to cause debounce to invoke `func` on the leading,
- * instead of the trailing, edge of the `wait` timeout.
+ * instead of the trailing, edge of the `wait` timeout. Subsequent calls to
+ * the debounced function will return the result of the last `func` call.
*
* @static
* @memberOf _
@@ -2012,7 +2022,8 @@
* Creates a new function that, when executed, will only call the `func`
* function at most once per every `wait` milliseconds. If the throttled function
* is invoked more than once, `func` will also be called on the trailing edge
- * of the `wait` timeout.
+ * of the `wait` timeout. Subsequent calls to the throttled function will
+ * return the result of the last `func` call.
*
* @static
* @memberOf _
@@ -2699,7 +2710,7 @@
*/
function escape(string) {
// the `>` character doesn't require escaping in HTML and has no special
- // meaning unless it's part of an open tag
+ // meaning unless it's part of a tag or an unquoted attribute value
// http://mathiasbynens.be/notes/ambiguous-ampersands (semi-related fun fact)
return (string + '')
.replace(/&/g, '&')
@@ -3199,7 +3210,7 @@
lodash.take = first;
lodash.unique = uniq;
- // add pseudo private template used and removed in the build process
+ // add pseudo private template used and removed during the build process
lodash._iteratorTemplate = iteratorTemplate;
/*--------------------------------------------------------------------------*/
diff --git a/lodash.min.js b/lodash.min.js
index 69ab31ede..4367b2aa8 100644
--- a/lodash.min.js
+++ b/lodash.min.js
@@ -1,12 +1,16 @@
-"use strict";var n=!0,o=null,r=!1;(function(u,m){function R(a){return"[object Arguments]"==h.call(a)}function c(a){return new p(a)}function p(a){if(a&&a._wrapped)return a;this._wrapped=a}function j(){for(var a,b,d,k=-1,c=arguments.length,f={e:"",f:"",k:"",q:"",c:{m:"++oarguments.length;c&&(b=v(b,c));if(e===+e){for(e&&f&&(d=a[--e]);e--;)d=b(d,a[e],e,a);return d}var g=U(a);for((e=g.length)&&f&&(d=a[g[--e]]);e--;)f=g[e],d=b(d,a[f],f,a);return d}function V(a,b,d){return b==m||d?a[0]:l.call(a,0,b)}function fa(a,b){if(b)return D.apply(z,a);for(var d,c=-1,e=a.length,f=[];++cw(f,b)&&W(e,function(a){return-1c&&(c=d,g=a[e]);return g}function ja(a,b,d){return l.call(a
-,b==m||d?1:b)}function ga(a,b,d){var c,e=0,f=a.length;for(d&&(b=d(b));e>1,(d?d(a[c]):a[c])f&&(b=n);++ew(i,c))i.push(c),g.push(a[e]);return g}function v(a,b){var d,c=h.call(a)==s;if(c){if(B)return a=B.call.apply(B,arguments),function(){return arguments.length?a.apply(m,arguments):a()}}else d=b,b=a;var e=l.call(arguments,2),f=e.length;return function(){var g;return g=
-arguments,c||(a=b[d]),f&&(g.length&&(e.length=f,E.apply(e,g)),g=e),g=g.length?a.apply(b,g):a.call(b),e.length=f,g}}function M(a,b,d){d||(d=[]);if(a===b)return 0!==a||1/a==1/b;if(a==m||b==m)return a===b;a.s&&(a=a._wrapped),b.s&&(b=b._wrapped);if(a.isEqual&&h.call(a.isEqual)==s)return a.isEqual(b);if(b.isEqual&&h.call(b.isEqual)==s)return b.isEqual(a);var c=h.call(a);if(c!=h.call(b))return r;switch(c){case K:return a==""+b;case N:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case la:case ma:return+a==+b;case na
-:return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return r;for(var e=d.length;e--;)if(d[e]==a)return n;var e=-1,f=n,g=0;d.push(a);if(c==I){if(g=a.length,f=g==b.length)for(;g--&&(f=M(a[g],b[g],d)););}else{if("constructor"in a!="constructor"in b||a.constructor!=b.constructor)return r;for(var i in a)if(t.call(a,i)&&(g++,!(f=t.call(b,i)&&M(a[i],b[i],d))))break;if(f){for(i in b)if(t.call(b,i)&&!(g--))break;f=!
-g}if(f&&H)for(;7>++e&&(i=ba[e],!t.call(a,i)||!!(f=t.call(b,i)&&M(a[i],b[i],d))););}return d.pop(),f}function ca(a){return a}function oa(a){F(O(a),function(b){var d=c[b]=a[b];p.prototype[b]=function(){var a=[this._wrapped];return arguments.length&&E.apply(a,arguments),a=1==a.length?d.call(c,a[0]):d.apply(c,a),this.s&&(a=new p(a),a.s=n),a}})}var X="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(u=global),exports),L=5e4;try{(function(){L=arguments.length}
-).apply(o,Array(L))}catch(Ha){}var wa={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},H=!{valueOf:0}.propertyIsEnumerable("valueOf"),Aa=0,S={"boolean":r,"function":n,object:n,number:r,string:r,"undefined":r},Ba=u._,A=RegExp("^"+({}.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Ca=/__token__(\d+)/g,Da=/['\n\r\t\u2028\u2029\\]/g,ba="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf"
+/*!
+ Lo-Dash 0.1.0 lodash.com/license
+ Underscore.js 1.3.3 github.com/documentcloud/underscore/blob/master/LICENSE
+*/
+;(function(u,m){"use strict";function R(a){return"[object Arguments]"==h.call(a)}function c(a){return new p(a)}function p(a){if(a&&a._wrapped)return a;this._wrapped=a}function j(){for(var a,b,d,k=-1,c=arguments.length,f={e:"",f:"",k:"",q:"",c:{m:"++oarguments.length;c&&(b=v(b,c));if(e===+e){for(e&&f&&(d=a[--e]);e--;)d=b(d,a[e],e,a);return d}var g=U(a);for((e=g.length)&&f&&(d=a[g[--e]]);e--;)f=g[e],d=b(d,a[f],f,a);return d}function V(a,b,d){return b==m||d?a[0]:l.call(a,0,b)}function fa(a,b){if(b)return D.apply(z,a);for(var d,c=-1,e=a.length,f=[];++cw(f,b)&&W(e,function(a){return-1c&&(c=d,g=a[e]);return g}function ja(a,b,d){return l.call(a,b==m||d?1:b)}function ga
+(a,b,d){var c,e=0,f=a.length;for(d&&(b=d(b));e>1,(d?d(a[c]):a[c])f&&(b=n);++ew(i,c))i.push(c),g.push(a[e]);return g}function v(a,b){var d,c=h.call(a)==s;if(c){if(B)return a=B.call.apply(B,arguments),function(){return arguments.length?a.apply(m,arguments):a()}}else d=b,b=a;var e=l.call(arguments,2),f=e.length;return function(){var g;return g=arguments,c||(a=b[d
+]),f&&(g.length&&(e.length=f,E.apply(e,g)),g=e),g=g.length?a.apply(b,g):a.call(b),e.length=f,g}}function M(a,b,d){d||(d=[]);if(a===b)return 0!==a||1/a==1/b;if(a==m||b==m)return a===b;a.s&&(a=a._wrapped),b.s&&(b=b._wrapped);if(a.isEqual&&h.call(a.isEqual)==s)return a.isEqual(b);if(b.isEqual&&h.call(b.isEqual)==s)return b.isEqual(a);var c=h.call(a);if(c!=h.call(b))return r;switch(c){case K:return a==""+b;case N:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case la:case ma:return+a==+b;case na:return a.source==
+b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return r;for(var e=d.length;e--;)if(d[e]==a)return n;var e=-1,f=n,g=0;d.push(a);if(c==I){if(g=a.length,f=g==b.length)for(;g--&&(f=M(a[g],b[g],d)););}else{if("constructor"in a!="constructor"in b||a.constructor!=b.constructor)return r;for(var i in a)if(t.call(a,i)&&(g++,!(f=t.call(b,i)&&M(a[i],b[i],d))))break;if(f){for(i in b)if(t.call(b,i)&&!(g--))break;f=!g}if(f&&H)for(;7>++
+e&&(i=ba[e],!t.call(a,i)||!!(f=t.call(b,i)&&M(a[i],b[i],d))););}return d.pop(),f}function ca(a){return a}function oa(a){F(O(a),function(b){var d=c[b]=a[b];p.prototype[b]=function(){var a=[this._wrapped];return arguments.length&&E.apply(a,arguments),a=1==a.length?d.call(c,a[0]):d.apply(c,a),this.s&&(a=new p(a),a.s=n),a}})}var n=!0,o=null,r=!1,X="object"==typeof exports&&exports&&("object"==typeof global&&global&&global==global.global&&(u=global),exports),L=5e4;try{(function(){L=arguments.length}).
+apply(o,Array(L))}catch(Ha){}var wa={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},H=!{valueOf:0}.propertyIsEnumerable("valueOf"),Aa=0,S={"boolean":r,"function":n,object:n,number:r,string:r,"undefined":r},Ba=u._,A=RegExp("^"+({}.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Ca=/__token__(\d+)/g,Da=/['\n\r\t\u2028\u2029\\]/g,ba="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf"
.split(" "),T="__token__",x=[],I="[object Array]",la="[object Boolean]",ma="[object Date]",s="[object Function]",N="[object Number]",na="[object RegExp]",K="[object String]",z=Array.prototype,y=Object.prototype,D=z.concat,t=y.hasOwnProperty,E=z.push,l=z.slice,h=y.toString,B=A.test(B=l.bind)&&/\n|Opera/.test(B+h.call(u.opera))&&B,C=A.test(C=Array.isArray)&&C,Ea=u.isFinite,Y=A.test(Y=Object.keys)&&Y,Fa=u.clearTimeout,P=u.setTimeout,ta=Function("u","var __p;with(u){__p='var o,z';if(k){__p+='='+k};__p+=';'+f+';'+q+';';if(c){__p+='var t='+g+'.length;o=-1;';if(o){__p+='if(t===+t){'};__p+=''+c['d']+';while('+c['m']+'){'+c['j']+'}';if(o){__p+='}'}}if(o){if(c){__p+='else{'}if(!i){__p+='var A=typeof '+l+'==\\'function\\';'};__p+=''+o['d']+';for('+o['m']+'){';if(i){if(r){__p+='if('+h+'){'};__p+=''+o['j']+';';if(r){__p+='}'}}else{__p+='if(!(A&&o==\\'prototype\\')';if(r){__p+='&&'+h};__p+='){'+o['j']+'}'};__p+='}';if(i){__p+='var j='+l+'.constructor;';for(var k=0;k<7;k++){__p+='o=\\''+p[k]+'\\';if(';if(p[k]=='constructor'){__p+='!(j&&j.prototype==='+l+')&&'};__p+=''+h+'){'+o['j']+'}'}}if(c){__p+='}'}};__p+=''+e+';return z'}return __p"
),q={a:"h,f,G",k:"h",q:"if(!f){f=n}else if(G){f=e(f,G)}",j:"f(h[o],o,h)"},Z={k:"I",j:"if(!f(h[o],o,h))return!z"},A={a:"u",k:"u",q:"for(var C,D=1,t=arguments.length;Dw(e,a[b])&&c.push(a[b]);return c},c.escape=function(a){re
,k=Function("_","return "+a)(c),b?k(b):(k.source=a,k)},c.throttle=function(a,b){function d(){i=new Date,g=m,a.apply(f,c)}var c,e,f,g,i=0;return function(){var h=new Date,j=b-(h-i);return c=arguments,f=this,0>=j?(i=h,e=a.apply(f,c)):g||(g=P(d,j)),e}},c.times=function(a,b,d){d&&(b=v(b,d));for(d=0;dw(b,d[a])&&b.push(d[a]);return b},c.uniq=ka,c.uniqueId=function(a){var b=Aa++;return a?a+b:b},c.values=ra,c.without=function(a){for(var b=l.call(arguments,1),d=-1,c=a.length,e=[];++dw(b,a[d])&&e.push(a[d]);return e},c.wrap=function(a,b){return function(){var c=[a];return arguments.length&&E.apply(c,arguments),b.apply(this,c)}},c.zip=function(){for(var a=-1,b=ia(Q(arguments,"length")),c=Array(b);++a