Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updating docs and minified version for 0.3.0

  • Loading branch information...
commit e381f7b626107165b86b7549b90b32245e934b8a 1 parent a82a01e
@jashkenas jashkenas authored
Showing with 13 additions and 4 deletions.
  1. +11 −2 index.html
  2. +1 −1  underscore-min.js
  3. +1 −1  underscore.js
View
13 index.html
@@ -107,11 +107,11 @@
<p>
<table>
<tr>
- <td><a href="underscore.js">Development Version (0.2.0)</a></td>
+ <td><a href="underscore.js">Development Version (0.3.0)</a></td>
<td><i>16kb, Uncompressed with Comments</i></td>
</tr>
<tr>
- <td><a href="underscore-min.js">Production Version (0.2.0)</a></td>
+ <td><a href="underscore-min.js">Production Version (0.3.0)</a></td>
<td><i>4kb, Packed and Gzipped</i></td>
</tr>
</table>
@@ -736,6 +736,15 @@
<h2>Change Log</h2>
<p>
+ <b class="header">0.3.0</b><br />
+ Added <a href="http://github.com/dmitryBaranovskiy">Dmitry Baranovskiy</a>'s
+ comprehensive optimizations, merged in
+ <a href="http://github.com/kriskowal/">Kris Kowal</a>'s patches to make Underscore
+ <a href="http://wiki.commonjs.org/wiki/CommonJS">CommonJS</a> and
+ <a href="http://narwhaljs.org/">Narwhal</a> compliant.
+ </p>
+
+ <p>
<b class="header">0.2.0</b><br />
Added <tt>compose</tt> and <tt>lastIndexOf</tt>, renamed <tt>inject</tt> to
<tt>reduce</tt>, added aliases for <tt>inject</tt>, <tt>filter</tt>,
View
2  underscore-min.js
@@ -1 +1 @@
-(function(){var a=(typeof window!="undefined")?window:exports;var c=a._;var b=a._={};b.VERSION="0.2.0";b.each=function(g,j,d){var k=0;try{if(g.forEach){g.forEach(j,d)}else{if(g.length){for(var h=0;h<g.length;h++){j.call(d,g[h],h)}}else{if(g.each){g.each(function(e){j.call(d,e,k++)})}else{var h=0;for(var n in g){var m=g[n],f=[n,m];f.key=n;f.value=m;j.call(d,f,h++)}}}}}catch(l){if(l!="__break__"){throw l}}return g};b.map=function(g,f,e){if(g&&g.map){return g.map(f,e)}var d=[];b.each(g,function(j,h){d.push(f.call(e,j,h))});return d};b.reduce=function(g,d,f,e){b.each(g,function(j,h){d=f.call(e,d,j,h)});return d};b.detect=function(g,f,e){var d;b.each(g,function(j,h){if(f.call(e,j,h)){d=j;throw"__break__"}});return d};b.select=function(g,f,e){if(g.filter){return g.filter(f,e)}var d=[];b.each(g,function(j,h){if(f.call(e,j,h)){d.push(j)}});return d};b.reject=function(g,f,e){var d=[];b.each(g,function(j,h){if(!f.call(e,j,h)){d.push(j)}});return d};b.all=function(g,f,e){f=f||function(h){return h};if(g.every){return g.every(f,e)}var d=true;b.each(g,function(j,h){d=d&&!!f.call(e,j,h);if(!d){throw"__break__"}});return d};b.any=function(g,f,e){f=f||function(h){return h};if(g.some){return g.some(f,e)}var d=false;b.each(g,function(j,h){if(d=!!f.call(e,j,h)){throw"__break__"}});return d};b.include=function(f,e){if(b.isArray(f)){return b.indexOf(f,e)!=-1}var d=false;b.each(f,function(g){if(g.value===e){d=true;throw"__break__"}});return d};b.invoke=function(e,f){var d=b.toArray(arguments).slice(2);return b.map(e,function(g){return(f?g[f]:g).apply(g,d)})};b.pluck=function(f,e){var d=[];b.each(f,function(g){d.push(g[e])});return d};b.max=function(g,f,e){if(!f&&b.isArray(g)){return Math.max.apply(Math,g)}var d;b.each(g,function(k,h){var j=f?f.call(e,k,h):k;if(d==null||j>=d.computed){d={value:k,computed:j}}});return d.value};b.min=function(g,f,e){if(!f&&b.isArray(g)){return Math.min.apply(Math,g)}var d;b.each(g,function(k,h){var j=f?f.call(e,k,h):k;if(d==null||j<d.computed){d={value:k,computed:j}}});return d.value};b.sortBy=function(f,e,d){return b.pluck(b.map(f,function(h,g){return{value:h,criteria:e.call(d,h,g)}}).sort(function(k,j){var h=k.criteria,g=j.criteria;return h<g?-1:h>g?1:0}),"value")};b.sortedIndex=function(j,h,f){f=f||function(k){return k};var d=0,g=j.length;while(d<g){var e=(d+g)>>1;f(j[e])<f(h)?d=e+1:g=e}return d};b.toArray=function(d){if(!d){return[]}if(b.isArray(d)){return d}return b.map(d,function(e){return e})};b.size=function(d){return b.toArray(d).length};b.first=function(d){return d[0]};b.last=function(d){return d[d.length-1]};b.compact=function(d){return b.select(d,function(e){return !!e})};b.flatten=function(d){return b.reduce(d,[],function(e,f){if(b.isArray(f)){return e.concat(b.flatten(f))}e.push(f);return e})};b.without=function(e){var d=e.slice.call(arguments,0);return b.select(e,function(f){return !b.include(d,f)})};b.uniq=function(e,d){return b.reduce(e,[],function(f,h,g){if(0==g||(d?b.last(f)!=h:!b.include(f,h))){f.push(h)}return f})};b.intersect=function(e){var d=b.toArray(arguments).slice(1);return b.select(b.uniq(e),function(f){return b.all(d,function(g){return b.indexOf(g,f)>=0})})};b.zip=function(){var d=b.toArray(arguments);var g=b.max(b.pluck(d,"length"));var f=new Array(g);for(var e=0;e<g;e++){f[e]=b.pluck(d,String(e))}return f};b.indexOf=function(e,d){if(e.indexOf){return e.indexOf(d)}for(i=0;i<e.length;i++){if(e[i]===d){return i}}return -1};b.lastIndexOf=function(e,d){if(e.lastIndexOf){return e.lastIndexOf(d)}for(i=e.length-1;i>=0;i--){if(e[i]===d){return i}}return -1};b.bind=function(f,e){if(!e){return f}var d=b.toArray(arguments).slice(2);return function(){var g=d.concat(b.toArray(arguments));return f.apply(e,g)}};b.bindAll=function(){var d=b.toArray(arguments);var e=d.pop();b.each(d,function(f){e[f]=b.bind(e[f],e)})};b.delay=function(e,f){var d=b.toArray(arguments).slice(2);return setTimeout(function(){return e.apply(e,d)},f)};b.defer=function(d){return b.delay.apply(b,[d,1].concat(b.toArray(arguments).slice(1)))};b.wrap=function(d,e){return function(){var f=[d].concat(b.toArray(arguments));return e.apply(e,f)}};b.compose=function(){var d=b.toArray(arguments);return function(){for(var e=d.length-1;e>=0;e--){arguments=[d[e].apply(this,arguments)]}return arguments[0]}};b.keys=function(d){return b.pluck(d,"key")};b.values=function(d){return b.pluck(d,"value")};b.extend=function(d,f){for(var e in f){d[e]=f[e]}return d};b.clone=function(d){return b.extend({},d)};b.isEqual=function(e,d){if(e===d){return true}var h=typeof(e),k=typeof(d);if(h!=k){return false}if(e==d){return true}if(e.isEqual){return e.isEqual(d)}if(h!=="object"){return false}var f=b.keys(e),j=b.keys(d);if(f.length!=j.length){return false}for(var g in e){if(!b.isEqual(e[g],d[g])){return false}}return true};b.isElement=function(d){return !!(d&&d.nodeType==1)};b.isArray=function(d){return Object.prototype.toString.call(d)=="[object Array]"};b.isFunction=function(d){return typeof d=="function"};b.isUndefined=function(d){return typeof d=="undefined"};b.noConflict=function(){a._=c;return this};b.uniqueId=function(d){var e=this._idCounter=(this._idCounter||0)+1;return d?d+e:e};b.template=function(f,e){var d=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+f.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return e?d(e):d};b.forEach=b.each;b.inject=b.reduce;b.filter=b.select;b.every=b.all;b.some=b.any;if(!b.isUndefined(exports)){exports=b}})();
+(function(){var d=(typeof window==="undefined"&&typeof exports!=="undefined");var c=d?null:window._;var a=function(e){return e};var b={};d?b=exports:window._=b;b.VERSION="0.3.0";b.each=function(j,m,f){var n=0;try{if(j.forEach){j.forEach(m,f)}else{if(j.length){for(var k=0,g=j.length;k<g;k++){m.call(f,j[k],k)}}else{if(j.each){j.each(function(e){m.call(f,e,n++)})}else{var k=0;for(var q in j){if(Object.prototype.hasOwnProperty.call(j,q)){var p=j[q],h=[q,p];h.key=q;h.value=p;m.call(f,h,k++)}}}}}}catch(o){if(o!="__break__"){throw o}}return j};b.map=function(h,g,f){if(h&&h.map){return h.map(g,f)}var e=[];b.each(h,function(k,j){e.push(g.call(f,k,j))});return e};b.reduce=function(h,e,g,f){b.each(h,function(k,j){e=g.call(f,e,k,j)});return e};b.detect=function(h,g,f){var e;b.each(h,function(k,j){if(g.call(f,k,j)){e=k;throw"__break__"}});return e};b.select=function(h,g,f){if(h.filter){return h.filter(g,f)}var e=[];b.each(h,function(k,j){g.call(f,k,j)&&e.push(k)});return e};b.reject=function(h,g,f){var e=[];b.each(h,function(k,j){!g.call(f,k,j)&&e.push(k)});return e};b.all=function(h,g,f){g=g||a;if(h.every){return h.every(g,f)}var e=true;b.each(h,function(k,j){if(!(e=e&&g.call(f,k,j))){throw"__break__"}});return e};b.any=function(h,g,f){g=g||a;if(h.some){return h.some(g,f)}var e=false;b.each(h,function(k,j){if(e=g.call(f,k,j)){throw"__break__"}});return e};b.include=function(g,f){if(b.isArray(g)){return b.indexOf(g,f)!=-1}var e=false;b.each(g,function(h){if(e=h.value===f){throw"__break__"}});return e};b.invoke=function(f,g){var e=b.toArray(arguments).slice(2);return b.map(f,function(h){return(g?h[g]:h).apply(h,e)})};b.pluck=function(g,f){var e=[];b.each(g,function(h){e.push(h[f])});return e};b.max=function(h,g,f){if(!g&&b.isArray(h)){return Math.max.apply(Math,h)}var e={computed:-Infinity};b.each(h,function(m,j){var k=g?g.call(f,m,j):m;k>=e.computed&&(e={value:m,computed:k})});return e.value};b.min=function(h,g,f){if(!g&&b.isArray(h)){return Math.min.apply(Math,h)}var e={computed:Infinity};b.each(h,function(m,j){var k=g?g.call(f,m,j):m;k<e.computed&&(e={value:m,computed:k})});return e.value};b.sortBy=function(g,f,e){return b.pluck(b.map(g,function(j,h){return{value:j,criteria:f.call(e,j,h)}}).sort(function(m,k){var j=m.criteria,h=k.criteria;return j<h?-1:j>h?1:0}),"value")};b.sortedIndex=function(k,j,g){g=g||a;var e=0,h=k.length;while(e<h){var f=(e+h)>>1;g(k[f])<g(j)?e=f+1:h=f}return e};b.toArray=function(e){if(!e){return[]}if(b.isArray(e)){return e}return b.map(e,function(f){return f})};b.size=function(e){return b.toArray(e).length};b.first=function(e){return e[0]};b.last=function(e){return e[e.length-1]};b.compact=function(e){return b.select(e,function(f){return !!f})};b.flatten=function(e){return b.reduce(e,[],function(f,g){if(b.isArray(g)){return f.concat(b.flatten(g))}f.push(g);return f})};b.without=function(f){var e=f.slice.call(arguments,0);return b.select(f,function(g){return !b.include(e,g)})};b.uniq=function(f,e){return b.reduce(f,[],function(g,j,h){if(0==h||(e?b.last(g)!=j:!b.include(g,j))){g.push(j)}return g})};b.intersect=function(f){var e=b.toArray(arguments).slice(1);return b.select(b.uniq(f),function(g){return b.all(e,function(h){return b.indexOf(h,g)>=0})})};b.zip=function(){var e=b.toArray(arguments);var h=b.max(b.pluck(e,"length"));var g=new Array(h);for(var f=0;f<h;f++){g[f]=b.pluck(e,String(f))}return g};b.indexOf=function(f,e){if(f.indexOf){return f.indexOf(e)}for(i=0,l=f.length;i<l;i++){if(f[i]===e){return i}}return -1};b.lastIndexOf=function(g,f){if(g.lastIndexOf){return g.lastIndexOf(f)}var e=g.length;while(e--){if(g[e]===f){return e}}return -1};b.bind=function(g,f){if(!f){return g}var e=b.toArray(arguments).slice(2);return function(){var h=e.concat(b.toArray(arguments));return g.apply(f,h)}};b.bindAll=function(){var e=b.toArray(arguments);var f=e.pop();b.each(e,function(g){f[g]=b.bind(f[g],f)})};b.delay=function(f,g){var e=b.toArray(arguments).slice(2);return setTimeout(function(){return f.apply(f,e)},g)};b.defer=function(e){return b.delay.apply(b,[e,1].concat(b.toArray(arguments).slice(1)))};b.wrap=function(e,f){return function(){var g=[e].concat(b.toArray(arguments));return f.apply(f,g)}};b.compose=function(){var e=b.toArray(arguments);return function(){for(var f=e.length-1;f>=0;f--){arguments=[e[f].apply(this,arguments)]}return arguments[0]}};b.keys=function(e){return b.pluck(e,"key")};b.values=function(e){return b.pluck(e,"value")};b.extend=function(e,g){for(var f in g){e[f]=g[f]}return e};b.clone=function(e){return b.extend({},e)};b.isEqual=function(f,e){if(f===e){return true}var j=typeof(f),m=typeof(e);if(j!=m){return false}if(f==e){return true}if(f.isEqual){return f.isEqual(e)}if(j!=="object"){return false}var g=b.keys(f),k=b.keys(e);if(g.length!=k.length){return false}for(var h in f){if(!b.isEqual(f[h],e[h])){return false}}return true};b.isElement=function(e){return !!(e&&e.nodeType==1)};b.isArray=function(e){return Object.prototype.toString.call(e)=="[object Array]"};b.isFunction=function(e){return Object.prototype.toString.call(e)=="[object Function]"};b.isUndefined=function(e){return typeof e=="undefined"};b.noConflict=function(){if(!d){window._=c}return this};b.uniqueId=function(e){var f=this._idCounter=(this._idCounter||0)+1;return e?e+f:f};b.template=function(g,f){var e=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+g.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return f?e(f):e};b.forEach=b.each;b.inject=b.reduce;b.filter=b.select;b.every=b.all;b.some=b.any})();
View
2  underscore.js
@@ -26,7 +26,7 @@
commonJS ? _ = exports : window._ = _;
// Current version.
- _.VERSION = '0.2.1';
+ _.VERSION = '0.3.0';
/*------------------------ Collection Functions: ---------------------------*/
Please sign in to comment.
Something went wrong with that request. Please try again.