diff --git a/build.js b/build.js index 5dd888c8c..3692660a6 100755 --- a/build.js +++ b/build.js @@ -436,6 +436,12 @@ var pair = command.split(separator); command = pair[0] + separator + '"' + pair[1] + '"'; } + // escape newlines, carriage returns, multi-line comment end tokens + command = command + .replace(/\n/g, '\\n') + .replace(/\r/g, '\\r') + .replace(/\*\//g, '*\\/'); + return command; }); // add build commands to copyright/license header @@ -1154,7 +1160,7 @@ */ function setUseStrictOption(source, value) { // inject or remove the "use strict" directive - source = source.replace(/(^[\s\S]*?function[^{]+{)(?:\s*'use strict';)?/, '$1' + (value ? "\n 'use strict';" : '')); + source = source.replace(/^([\s\S]*?function[^{]+{)(?:\s*'use strict';)?/, '$1' + (value ? "\n 'use strict';" : '')); // replace `strict` branch in `iteratorTemplate` with hard-coded option source = source.replace(getIteratorTemplate(source), function(match) { @@ -2168,6 +2174,12 @@ if (!isDebug) { outputPath || (outputPath = path.join(cwd, basename + '.min.js')); + // convert the IIFE into a function call so Closure Compiler (advanced) won't strip it + if (!isIIFE) { + source = source + .replace(/\(function/, 'iife$&') + .replace(/\(this\)\)(;\s*)$/, ', this)$1'); + } minify(source, { 'filePath': filePath, 'isMapped': isMapped, @@ -2176,9 +2188,15 @@ 'modes': isIIFE && ['simple', 'hybrid'], 'outputPath': outputPath, 'onComplete': function(data) { + // restore IIFE + if (!isIIFE) { + data.source = data.source + .replace(/iife\(/, '(') + .replace(/, *this\)([\s;]*(\n\/\/.+)?)$/, '(this))$1'); + } // inject "use strict" directive if (isStrict) { - data.source = data.source.replace(/^([\s\S]*?function[^{]+{)([^"'])/, '$1"use strict";$2'); + data.source = data.source.replace(/^([\s\S]*?function[^{]+{\s*)([^"'])/, '$1"use strict";$2'); } if (isCustom) { data.source = addCommandsToHeader(data.source, options); diff --git a/build/minify.js b/build/minify.js index e45cd324f..ceca16238 100755 --- a/build/minify.js +++ b/build/minify.js @@ -120,8 +120,7 @@ source = fs.readFileSync(filePath, 'utf8'); } - modes = options.modes || (options.modes = modes); - + modes = options.modes || modes; if (options.isMapped) { modes = modes.filter(function(mode) { return mode != 'hybrid'; @@ -129,9 +128,11 @@ } if (options.isTemplate) { modes = modes.filter(function(mode) { - mode != 'advanced'; + return mode != 'advanced'; }); } + options.modes = modes; + // fetch the Closure Compiler getDependency({ 'id': 'closure-compiler', @@ -450,7 +451,7 @@ if (this.modes.indexOf('advanced') > -1) { closureCompile.call(this, this.source, 'advanced', onClosureAdvancedCompile.bind(this)); } else { - onComplete.call(this); + onClosureAdvancedGzip.call(this); } } diff --git a/build/post-compile.js b/build/post-compile.js index be0624953..2dcdccdf5 100644 --- a/build/post-compile.js +++ b/build/post-compile.js @@ -28,7 +28,7 @@ source = source.replace(/^\/\**[\s\S]+?\*\/\n/, ''); // move vars exposed by the Closure Compiler into the IIFE - source = source.replace(/^((?:(['"])use strict\2;)?(?:var (?:[a-z]+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^)]+\){)/, '$3$1'); + source = source.replace(/^((?:var (?:\w+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^)]+\){)/, '$2$1'); // correct overly aggressive Closure Compiler advanced optimizations source = source diff --git a/lodash.min.js b/lodash.min.js index f391a51f6..38ca3c18b 100644 --- a/lodash.min.js +++ b/lodash.min.js @@ -3,44 +3,39 @@ * Lo-Dash 1.0.0-rc.3 lodash.com/license * Underscore.js 1.4.3 underscorejs.org/LICENSE */ -;(function(z,ea){function c(a){if(a&&typeof a=="object"&&a.__wrapped__)return a;if(!(this instanceof c))return new c(a);this.__wrapped__=a}function fa(a,b,d){b||(b=0);var e=a.length,f=e-b>=(d||cb);if(f){var g={};for(d=b-1;++db||typeof a=="undefined")return 1; -if(af;f++)e+="f='"+a.j[f]+"';if(","constructor"==a.j[f]&&(e+="!(d&&d.prototype===i)&&"),e+="e.call(i,f)){"+a.g+"}"}if(a.b||a.h)e+="}";e+=a.c+";return p";return d("c,e,g,h,l,k,o","return function("+b+"){"+e+"}")(l,p,w,B,Ea,I,Fa)}function fb(a){return"\\"+gb[a]}function hb(a){return Ga[a]}function X(a){return typeof a.toString!="function"&&typeof(a+"")=="string"}function ga(){}function n(a,b,d){b||(b=0);typeof d=="undefined"&&(d=a?a.length:0);var e=-1;d=d-b||0;for(var f=Array(0>d?0:d);++e< -d;)f[e]=a[b+e];return f}function ib(a){return jb[a]}function w(a){return s.call(a)==M}function Ha(a){var b=!1;if(!(a&&typeof a=="object")||w(a))return b;var d=a.constructor;if(!v(d)&&(!ja||!X(a))||d instanceof d){if(Ia)return C(a,function(a,d,c){b=!p.call(c,d);return!1}),!1===b;C(a,function(a,d){b=d});return!1===b||p.call(a,b)}return b}function Ja(a){var b=[];x(a,function(a,e){b.push(e)});return b}function ka(a,b,d){for(var e=arguments,f=0,c=typeof d=="number"?2:e.length;++fd?E(0,f+d):d)||0;typeof f=="number"?c=-1<(B(a)?a.indexOf(b,d):F(a,b,d)):t(a,function(a){if(++e>=d)return!(c=a===b)});return c}function Oa(a,b,d){var e=!0;b=l(b,d);if(m(a)){d=-1;for(var c=a.length;++dc&&(c=h)}}else b=!b&&B(a)?Ba:l(b,d),t(a,function(a,d,g){d=b(a, -d,g);d>e&&(e=d,c=a)});return c}function ra(a,b){return qa(a,b+"")}function sa(a,b,d,e){var c=3>arguments.length;b=l(b,e,S);if(m(a)){var g=-1,h=a.length;for(c&&(d=a[++g]);++garguments.length;if(typeof g!="number")var k=A(a),g=k.length;else W&&B(a)&&(c=a.split(""));b=l(b,e,S);r(a,function(a,e,l){e=k?k[--g]:--g;d=h?(h=!1,c[e]):b(d,c[e],e,l)});return d}function Sa(a,b,d){var e; -b=l(b,d);if(m(a)){d=-1;for(var c=a.length;++dd?E(0,c+d):d|| -0)-1;else if(d)return e=Ua(a,b),a[e]===b?e:-1;for(;++e>>1,d(a[e])F(k,n))(d||j)&&k.push(n),h.push(e)}return h}function Va(a,b){return lb||H&&2|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,pb=/&(?:amp|lt|gt|quot|#x27);/g,qb=/\b__p\+='';/g,rb=/\b(__p\+=)''\+/g,sb=/(__e\(.*?\)|\b__t\))\+'';/g,kb=/\w*$/,tb=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,ba=RegExp("^"+(T.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ub=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,Ya=/<%=([\s\S]+?)%>/g,ca=/($^)/, -vb=/[&<>"']/g,wb=/['\n\r\t\u2028\u2029\\]/g,eb="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),xb=Math.ceil,K=u.concat,Za=Math.floor,L=ba.test(L=Object.getPrototypeOf)&&L,p=T.hasOwnProperty,aa=u.push,Fa=T.propertyIsEnumerable,s=T.toString,H=ba.test(H=n.bind)&&H,za=ba.test(za=Array.isArray)&&za,yb=z.isFinite,zb=z.isNaN,I=ba.test(I=Object.keys)&&I,E=Math.max,ua=Math.min,$a=Math.random,M="[object Arguments]",R="[object Array]",N="[object Boolean]", -O="[object Date]",P="[object Number]",G="[object Object]",Q="[object RegExp]",J="[object String]",Ab=!!z.attachEvent,lb=H&&/\n|true/.test(H+Ab),Ca,Ia,da=(da={"0":1,length:1},u.splice.call(da,0,1),da[0]),Da=!0;(function(){function a(){this.x=1}var b=[];a.prototype={valueOf:1,y:1};for(var d in new a)b.push(d);for(d in arguments)Da=!d;Ca=!/valueOf/.test(b);Ia="x"!=b[0]})(1);var na=arguments.constructor==Object,ab=!w(arguments),W="xx"!="x"[0]+Object("x")[0];try{var ja=s.call(document)==G&&!1}catch(Bb){}var y= -{"[object Function]":!1};y[M]=y[R]=y[N]=y[O]=y[P]=y[G]=y[Q]=y[J]=!0;var D={};D[R]=Array;D[N]=Boolean;D[O]=Date;D[G]=Object;D[P]=Number;D[Q]=RegExp;D[J]=String;var Ea={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},gb={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"};c.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:Ya,variable:"",imports:{_:c}};var Aa={b:!0,a:"b,a,r",k:"a=a&&typeof r=='undefined'?a:c(a,r)",g:"if(a(i[f],f,b)===false)return p"}, -bb={b:!1},t=ia(Aa);ab&&(w=function(a){return a?p.call(a,"callee"):!1});var C=ia(Aa,bb,{l:!1}),x=ia(Aa,bb),A=!I?Ja:function(a){return typeof a=="function"&&Fa.call(a,"prototype")?Ja(a):V(a)?I(a):[]},Ga={"&":"&","<":"<",">":">",'"':""","'":"'"},jb=Ka(Ga),m=za||function(a){return na&&a instanceof Array||s.call(a)==R};v(/x/)&&(v=function(a){return a instanceof Function||"[object Function]"==s.call(a)});var oa=!L?Ha:function(a){if(!(a&&typeof a=="object"))return!1;var b=a.valueOf,d= -typeof b=="function"&&(d=L(b))&&L(d);return d?a==d||L(a)==d&&!w(a):Ha(a)};c.after=function(a,b){return 1>a?b():function(){if(1>--a)return b.apply(this,arguments)}};c.assign=ka;c.at=function(a){var b=-1,d=K.apply(u,n(arguments,1)),e=d.length,c=Array(e);for(W&&B(a)&&(a=a.split(""));++bF(j,q)){h&&j.push(q);for(var m=d;--m;)if(!(e[m]||(e[m]=fa(b[m], -0,100)))(q))continue a;k.push(q)}}return k};c.invert=Ka;c.invoke=function(a,b){var d=n(arguments,2),e=-1,c=typeof b=="function",g=a?a.length:0,h=Array(typeof g=="number"?g:0);r(a,function(a){h[++e]=(c?b:a[b]).apply(a,d)});return h};c.keys=A;c.map=qa;c.max=Qa;c.memoize=function(a,b){var d={};return function(){var e=(b?b.apply(this,arguments):arguments[0])+"";return p.call(d,e)?d[e]:d[e]=a.apply(this,arguments)}};c.merge=Ma;c.min=function(a,b,d){var e=Infinity,c=e;if(!b&&m(a)){d=-1;for(var g=a.length;++d< -g;){var h=a[d];hF(g,d,1))c[d]=a});return c};c.once=function(a){var b,d;return function(){if(b)return d;b=!0;d=a.apply(this,arguments);a=null;return d}};c.pairs= -function(a){for(var b=-1,d=A(a),e=d.length,c=Array(e);++b=l?(clearTimeout(h),h=null,k=j,f=a.apply(g,c)):h||(h=setTimeout(d,l));return f}};c.times=function(a,b,d){a=+a||0;for(var c=-1,f=Array(a);++cd?E(0,c+d):ua(d,c-1))+ -1);c--;)if(a[c]===b)return c;return-1};c.mixin=Wa;c.noConflict=function(){z._=nb;return this};c.random=function(a,b){null==a&&null==b&&(b=1);a=+a||0;null==b&&(b=a,a=0);return a+Za($a()*((+b||0)-a+1))};c.reduce=sa;c.reduceRight=Ra;c.result=function(a,b){var c=a?a[b]:null;return v(c)?a[b]():c};c.size=function(a){var b=a?a.length:0;return typeof b=="number"?b:A(a).length};c.some=Sa;c.sortedIndex=Ua;c.template=function(a,b,d){var e=c.templateSettings;a||(a="");d=ma({},d,e);var f=ma({},d.imports,e.imports), -e=A(f),f=pa(f),g=0,h=d.interpolate||ca,k=!(1==e.length&&"_"==e[0]&&f[0]===c),j="__p+='";a.replace(RegExp((d.escape||ca).source+"|"+h.source+"|"+(h===Ya?ub:ca).source+"|"+(d.evaluate||ca).source+"|$","g"),function(b,c,d,e,f,h){d||(d=e);j+=a.slice(g,h).replace(wb,fb);c&&(j+="'+__e("+c+")+'");f&&(j+="';"+f+";__p+='");d&&(j+="'+((__t=("+d+"))==null?'':__t)+'");k||(k=f||ob.test(c||d));g=h+b.length;return b});j+="';\n";h=d=d.variable;if(!h)if(d="obj",k)j="with("+d+"){"+j+"}";else var l=RegExp("(\\(\\s*)"+ -d+"\\."+d+"\\b","g"),j=j.replace(tb,"$&"+d+".").replace(l,"$1__d");j=(k?j.replace(qb,""):j).replace(rb,"$1").replace(sb,"$1;");j="function("+d+"){"+(h?"":d+"||("+d+"={});")+"var __t,__p='',__e=_.escape"+(k?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(h?"":",__d="+d+"."+d+"||"+d)+";")+j+"return __p}";try{var m=Function(e,"return "+j).apply(ea,f)}catch(n){throw n.source=j,n;}if(b)return m(b);m.source=j;return m};c.unescape=function(a){return null==a?"":(a+"").replace(pb, -ib)};c.uniqueId=function(a){var b=++mb;return(null==a?"":a+"")+b};c.all=Oa;c.any=Sa;c.detect=Pa;c.foldl=sa;c.foldr=Ra;c.include=Na;c.inject=sa;x(c,function(a,b){c.prototype[b]||(c.prototype[b]=function(){var b=[this.__wrapped__];aa.apply(b,arguments);return a.apply(c,b)})});c.first=ta;c.last=function(a,b,c){if(a){var e=0,f=a.length;if(typeof b=="function"){var g=f;for(b=l(b,c);g--&&b(a[g],g,a);)e++}else if(e=b,null==e||c)return a[f-1];return n(a,E(0,f-e))}};c.take=ta;c.head=ta;x(c,function(a,b){c.prototype[b]|| -(c.prototype[b]=function(b,e){var f=a(this.__wrapped__,b,e);return null==b||e&&typeof b!="function"?f:new c(f)})});c.VERSION="1.0.0-rc.3";c.prototype.toString=function(){return this.__wrapped__+""};c.prototype.value=Xa;c.prototype.valueOf=Xa;t(["join","pop","shift"],function(a){var b=u[a];c.prototype[a]=function(){return b.apply(this.__wrapped__,arguments)}});t(["push","reverse","sort","unshift"],function(a){var b=u[a];c.prototype[a]=function(){b.apply(this.__wrapped__,arguments);return this}});t(["concat", -"slice","splice"],function(a){var b=u[a];c.prototype[a]=function(){return new c(b.apply(this.__wrapped__,arguments))}});da&&t(["pop","shift","splice"],function(a){var b=u[a],d="splice"==a;c.prototype[a]=function(){var a=this.__wrapped__,f=b.apply(a,arguments);0===a.length&&delete a[0];return d?new c(f):f}});typeof define=="function"&&typeof define.amd=="object"&&define.amd?(z._=c,define(function(){return c})):xa?typeof module=="object"&&module&&module.exports==xa?(module.exports=c)._=c:xa._=c:z._= -c})(this); \ No newline at end of file +;(function(n,t){function r(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof r?(this.__wrapped__=n,void 0):new r(n)}function e(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||ot);if(u){var o={};for(r=t-1;++rt||typeof n=="undefined")return 1;if(nu;u++)e+="f='"+t.j[u]+"';if(","constructor"==t.j[u]&&(e+="!(d&&d.prototype===i)&&"),e+="e.call(i,f)){"+t.g+"}"}return(t.b||t.h)&&(e+="}"),e+=t.c+";return p",r("c,e,g,h,l,k,o","return function("+n+"){"+e+"}")(a,At,h,E,rr,Ft,Et)}function c(n){return"\\"+er[n]}function l(n){return lr[n]}function p(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function s(){}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++er?Dt(0,u+r):r)||0,typeof u=="number"?o=-1<(E(n)?n.indexOf(t,r):L(n,t,r)):ir(n,function(n){return++eo&&(o=f)}}else t=!t&&E(n)?u:a(t,r),ir(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function B(n,t){return I(n,t+"")}function M(n,t,r,e){var u=3>arguments.length;if(t=a(t,e,ut),sr(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++oarguments.length;if(typeof o!="number")var f=cr(n),o=f.length;else Xt&&E(n)&&(u=n.split(""));return t=a(t,e,ut),D(n,function(n,e,a){e=f?f[--o]:--o,r=i?(i=!1,u[e]):t(r,u[e],e,a)}),r}function z(n,t,r){var e;if(t=a(t,r),sr(n)){r=-1;for(var u=n.length;++rr?Dt(0,u+r):r||0)-1;else if(r)return e=V(n,t),n[e]===t?e:-1;for(;++e>>1,r(n[e])L(f,p))&&((r||c)&&f.push(p),i.push(e))}return i}function H(n,t){return Gt||$t&&2|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,ft=/&(?:amp|lt|gt|quot|#x27);/g,ct=/\b__p\+='';/g,lt=/\b(__p\+=)''\+/g,pt=/(__e\(.*?\)|\b__t\))\+'';/g,st=/\w*$/,vt=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,gt=RegExp("^"+(rt.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ht=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,yt=/<%=([\s\S]+?)%>/g,mt=/($^)/,_t=/[&<>"']/g,dt=/['\n\r\t\u2028\u2029\\]/g,bt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),jt=Math.ceil,wt=tt.concat,xt=Math.floor,Ot=gt.test(Ot=Object.getPrototypeOf)&&Ot,At=rt.hasOwnProperty,St=tt.push,Et=rt.propertyIsEnumerable,kt=rt.toString,$t=gt.test($t=v.bind)&&$t,Rt=gt.test(Rt=Array.isArray)&&Rt,qt=n.isFinite,Nt=n.isNaN,Ft=gt.test(Ft=Object.keys)&&Ft,Dt=Math.max,It=Math.min,Tt=Math.random,Bt="[object Arguments]",Mt="[object Array]",Pt="[object Boolean]",zt="[object Date]",Ct="[object Number]",Kt="[object Object]",Lt="[object RegExp]",Ut="[object String]",Vt=!!n.attachEvent,Gt=$t&&/\n|true/.test($t+Vt),Ht=(Ht={0:1,length:1},tt.splice.call(Ht,0,1),Ht[0]),Jt=!0; +(function(){function n(){this.x=1}var t=[];n.prototype={valueOf:1,y:1};for(var r in new n)t.push(r);for(r in arguments)Jt=!r;Z=!/valueOf/.test(t),nt="x"!=t[0]})(1);var Qt=arguments.constructor==Object,Wt=!h(arguments),Xt="xx"!="x"[0]+Object("x")[0];try{var Yt=kt.call(document)==Kt&&!1}catch(Zt){}var nr={"[object Function]":!1};nr[Bt]=nr[Mt]=nr[Pt]=nr[zt]=nr[Ct]=nr[Kt]=nr[Lt]=nr[Ut]=!0;var tr={};tr[Mt]=Array,tr[Pt]=Boolean,tr[zt]=Date,tr[Kt]=Object,tr[Ct]=Number,tr[Lt]=RegExp,tr[Ut]=String;var rr={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},er={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"}; +r.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:yt,variable:"",imports:{_:r}};var ur={b:!0,a:"b,a,r",k:"a=a&&typeof r=='undefined'?a:c(a,r)",g:"if(a(i[f],f,b)===false)return p"},or={b:!1},ir=f(ur);Wt&&(h=function(n){return n?At.call(n,"callee"):!1});var ar=f(ur,or,{l:!1}),fr=f(ur,or),cr=Ft?function(n){return typeof n=="function"&&Et.call(n,"prototype")?m(n):A(n)?Ft(n):[]}:m,lr={"&":"&","<":"<",">":">",'"':""","'":"'"},pr=w(lr),sr=Rt||function(n){return Qt&&n instanceof Array||kt.call(n)==Mt +};O(/x/)&&(O=function(n){return n instanceof Function||"[object Function]"==kt.call(n)});var vr=Ot?function(n){if(!n||typeof n!="object")return!1;var t=n.valueOf,r=typeof t=="function"&&(r=Ot(t))&&Ot(r);return r?n==r||Ot(n)==r&&!h(n):y(n)}:y;r.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},r.assign=_,r.at=function(n){var t=-1,r=wt.apply(tt,v(arguments,1)),e=r.length,u=Array(e);for(Xt&&E(n)&&(n=n.split(""));++tL(c,l)){a&&c.push(l);for(var s=r;--s;)if(!(u[s]||(u[s]=e(t[s],0,100)))(l))continue n; +f.push(l)}}return f},r.invert=w,r.invoke=function(n,t){var r=v(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return D(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},r.keys=cr,r.map=I,r.max=T,r.memoize=function(n,t){var r={};return function(){var e=(t?t.apply(this,arguments):arguments[0])+"";return At.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},r.merge=k,r.min=function(n,t,r){var e=1/0,o=e;if(!t&&sr(n)){r=-1;for(var i=n.length;++rL(o,r,1))&&(u[r]=n)}),u},r.once=function(n){var t,r;return function(){return t?r:(t=!0,r=n.apply(this,arguments),n=null,r)}},r.pairs=function(n){for(var t=-1,r=cr(n),e=r.length,u=Array(e);++tr?Dt(0,e+r):It(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},r.mixin=Q,r.noConflict=function(){return n._=it,this},r.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+xt(Tt()*((+t||0)-n+1))},r.reduce=M,r.reduceRight=P,r.result=function(n,t){var r=n?n[t]:null;return O(r)?n[t]():r},r.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:cr(n).length +},r.some=z,r.sortedIndex=V,r.template=function(n,e,u){var o=r.templateSettings;n||(n=""),u=b({},u,o);var i=b({},u.imports,o.imports),o=cr(i),i=$(i),a=0,f=u.interpolate||mt,l=!(1==o.length&&"_"==o[0]&&i[0]===r),p="__p+='";if(n.replace(RegExp((u.escape||mt).source+"|"+f.source+"|"+(f===yt?ht:mt).source+"|"+(u.evaluate||mt).source+"|$","g"),function(t,r,e,u,o,i){return e||(e=u),p+=n.slice(a,i).replace(dt,c),r&&(p+="'+__e("+r+")+'"),o&&(p+="';"+o+";__p+='"),e&&(p+="'+((__t=("+e+"))==null?'':__t)+'"),l||(l=o||at.test(r||e)),a=i+t.length,t +}),p+="';\n",f=u=u.variable,!f)if(u="obj",l)p="with("+u+"){"+p+"}";else var s=RegExp("(\\(\\s*)"+u+"\\."+u+"\\b","g"),p=p.replace(vt,"$&"+u+".").replace(s,"$1__d");p=(l?p.replace(ct,""):p).replace(lt,"$1").replace(pt,"$1;"),p="function("+u+"){"+(f?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(l?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(f?"":",__d="+u+"."+u+"||"+u)+";")+p+"return __p}";try{var v=Function(o,"return "+p).apply(t,i)}catch(g){throw g.source=p,g}return e?v(e):(v.source=p,v) +},r.unescape=function(n){return null==n?"":(n+"").replace(ft,g)},r.uniqueId=function(n){var t=++et;return(null==n?"":n+"")+t},r.all=q,r.any=z,r.detect=F,r.foldl=M,r.foldr=P,r.include=R,r.inject=M,fr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(){var t=[this.__wrapped__];return St.apply(t,arguments),n.apply(r,t)})}),r.first=C,r.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t=="function"){var o=u;for(t=a(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n[u-1];return v(n,Dt(0,u-e)) +}},r.take=C,r.head=C,fr(r,function(n,t){r.prototype[t]||(r.prototype[t]=function(t,e){var u=n(this.__wrapped__,t,e);return null==t||e&&typeof t!="function"?u:new r(u)})}),r.VERSION="1.0.0-rc.3",r.prototype.toString=function(){return this.__wrapped__+""},r.prototype.value=W,r.prototype.valueOf=W,ir(["join","pop","shift"],function(n){var t=tt[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),ir(["push","reverse","sort","unshift"],function(n){var t=tt[n];r.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this +}}),ir(["concat","slice","splice"],function(n){var t=tt[n];r.prototype[n]=function(){return new r(t.apply(this.__wrapped__,arguments))}}),Ht&&ir(["pop","shift","splice"],function(n){var t=tt[n],e="splice"==n;r.prototype[n]=function(){var n=this.__wrapped__,u=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new r(u):u}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=r,define(function(){return r})):X?typeof module=="object"&&module&&module.exports==X?(module.exports=r)._=r:X._=r:n._=r +}(this)); \ No newline at end of file diff --git a/lodash.underscore.min.js b/lodash.underscore.min.js index 7fb7e2e15..b9d2d4a72 100644 --- a/lodash.underscore.min.js +++ b/lodash.underscore.min.js @@ -29,4 +29,4 @@ o in n&&(u[o]=n[o])}return u},u.pluck=F,u.range=function(n,t,r){n=+n||0,r=+r||1, },u.reduce=R,u.reduceRight=T,u.result=function(n,t){var r=n?n[t]:G;return m(r)?n[t]():r},u.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:kt(n).length},u.some=q,u.sortedIndex=I,u.template=function(n,t,r){n||(n=""),r=g({},r,u.templateSettings);var e=0,o="__p+='",i=r.variable;n.replace(RegExp((r.escape||nt).source+"|"+(r.interpolate||nt).source+"|"+(r.evaluate||nt).source+"|$","g"),function(t,r,u,i,f){o+=n.slice(e,f).replace(rt,a),o+=r?"'+_['escape']("+r+")+'":i?"';"+i+";__p+='":u?"'+((__t=("+u+"))==null?'':__t)+'":"",e=f+t.length }),o+="';\n",i||(i="obj",o="with("+i+"||{}){"+o+"}"),o="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+o+"return __p}";try{var f=Function("_","return "+o)(u)}catch(c){throw c.source=o,c}return t?f(t):(f.source=o,f)},u.unescape=function(n){return n==G?"":(n+"").replace(Y,s)},u.uniqueId=function(n){var t=++Q+"";return n?n+t:t},u.all=x,u.any=q,u.detect=O,u.foldl=R,u.foldr=T,u.include=A,u.inject=R,u.first=B,u.last=function(n,t,r){if(n){var e=0,u=n.length; if(typeof t=="function"){var o=u;for(t=i(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==G||r)return n[u-1];return l(n,gt(0,u-e))}},u.take=B,u.head=B,u.chain=function(n){return n=new u(n),n.__chain__=V,n},u.VERSION="1.0.0-rc.3",U(u),u.prototype.chain=function(){return this.__chain__=V,this},u.prototype.value=function(){return this.__wrapped__},e("pop push reverse shift sort splice unshift".split(" "),function(n){var t=L[n];u.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),Et&&0===n.length&&delete n[0],this -}}),e(["concat","join","slice"],function(n){var t=L[n];u.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new u(n),n.__chain__=V),n}}),J?typeof module=="object"&&module&&module.exports==J?(module.exports=u)._=u:J._=u:n._=u})(this); \ No newline at end of file +}}),e(["concat","join","slice"],function(n){var t=L[n];u.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new u(n),n.__chain__=V),n}}),J?typeof module=="object"&&module&&module.exports==J?(module.exports=u)._=u:J._=u:n._=u}(this)); \ No newline at end of file