From e381f7b626107165b86b7549b90b32245e934b8a Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Thu, 29 Oct 2009 00:04:00 -0400 Subject: [PATCH] updating docs and minified version for 0.3.0 --- index.html | 13 +++++++++++-- underscore-min.js | 2 +- underscore.js | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 88c32d94f..99380fece 100644 --- a/index.html +++ b/index.html @@ -107,11 +107,11 @@

- + - +
Development Version (0.2.0)Development Version (0.3.0) 16kb, Uncompressed with Comments
Production Version (0.2.0)Production Version (0.3.0) 4kb, Packed and Gzipped
@@ -735,6 +735,15 @@ _.template(list, {people : ['moe', 'curly', 'larry']});

Change Log

+

+ 0.3.0
+ Added Dmitry Baranovskiy's + comprehensive optimizations, merged in + Kris Kowal's patches to make Underscore + CommonJS and + Narwhal compliant. +

+

0.2.0
Added compose and lastIndexOf, renamed inject to diff --git a/underscore-min.js b/underscore-min.js index 98d0437b5..65150df82 100644 --- a/underscore-min.js +++ b/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=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||jg?1:0}),"value")};b.sortedIndex=function(j,h,f){f=f||function(k){return k};var d=0,g=j.length;while(d>1;f(j[e])=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=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}})(); \ No newline at end of file +(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=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;kh?1:0}),"value")};b.sortedIndex=function(k,j,g){g=g||a;var e=0,h=k.length;while(e>1;g(k[f])=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=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})(); \ No newline at end of file diff --git a/underscore.js b/underscore.js index 8fa0379f4..9c050fc80 100644 --- a/underscore.js +++ b/underscore.js @@ -26,7 +26,7 @@ commonJS ? _ = exports : window._ = _; // Current version. - _.VERSION = '0.2.1'; + _.VERSION = '0.3.0'; /*------------------------ Collection Functions: ---------------------------*/