diff --git a/build.js b/build.js index 6b546d441..e8d52ded3 100755 --- a/build.js +++ b/build.js @@ -77,7 +77,7 @@ /** Used to track function dependencies */ var dependencyMap = { 'after': [], - 'assign': ['isArray', 'forEach', 'forOwn'], + 'assign': ['isArray', 'keys'], 'at': ['isString'], 'bind': ['isFunction', 'isObject'], 'bindAll': ['bind', 'functions'], @@ -90,7 +90,7 @@ 'countBy': ['createCallback', 'forEach'], 'createCallback': ['identity', 'isEqual', 'keys'], 'debounce': [], - 'defaults': ['isArray', 'forEach', 'forOwn'], + 'defaults': ['isArray', 'keys'], 'defer': ['bind'], 'delay': [], 'difference': ['indexOf'], @@ -102,9 +102,9 @@ 'findKey': ['createCallback'], 'first': [], 'flatten': ['createCallback', 'isArray'], - 'forEach': ['createCallback', 'isArguments', 'isArray', 'isString'], + 'forEach': ['createCallback', 'isArguments', 'isArray', 'isString', 'keys'], 'forIn': ['createCallback', 'isArguments'], - 'forOwn': ['createCallback', 'isArguments'], + 'forOwn': ['createCallback', 'isArguments', 'keys'], 'functions': ['forIn', 'isFunction'], 'groupBy': ['createCallback', 'forEach'], 'has': [], @@ -947,8 +947,8 @@ modified = snippet .replace(RegExp('\\b' + identifier + '\\b,? *', 'g'), '') - .replace(/, *',/, "',") - .replace(/,\s*\)/, ')') + .replace(/, *(?=',)/, '') + .replace(/,(?=\s*\))/, '') source = source.replace(snippet, function() { return modified; @@ -1354,6 +1354,9 @@ if (/^(?:cloneableClasses|contextProps|ctorByClass|shadowedProps)$/.test(varName)) { source = source.replace(RegExp('(var ' + varName + ' *=)[\\s\\S]+?\\n\\n'), '$1=null;\n\n'); } + + source = removeFunction(source, varName); + source = source.replace(RegExp( // match multi-line comment block '(?:\\n +/\\*[^*]*\\*+(?:[^/][^*]*\\*+)*/)?\\n' + @@ -1370,7 +1373,7 @@ // remove a variable at the end of a variable declaration list source = source.replace(RegExp(',\\s*' + varName + ' *=.+?;'), ';'); - return removeFromCreateIterator(source, varName); + return source; } /** @@ -2723,6 +2726,8 @@ }); } if (isRemoved(source, 'value')) { + source = removeFunction(source, 'wrapperToString'); + source = removeFunction(source, 'wrapperValueOf'); source = removeSupportSpliceObjects(source); source = removeLodashWrapper(source); @@ -2780,11 +2785,15 @@ if (isRemoved(source, 'clone', 'isEqual', 'isPlainObject')) { source = removeSupportNodeClass(source); } + if (!/\beach\(/.test(source)) { + source = source.replace(matchFunction(source, 'each'), ''); + } if ((source.match(/\bcreateIterator\b/g) || []).length < 2) { source = removeFunction(source, 'createIterator'); source = removeVar(source, 'defaultsIteratorOptions'); source = removeVar(source, 'eachIteratorOptions'); source = removeVar(source, 'forOwnIteratorOptions'); + source = removeVar(source, 'iteratorTemplate'); source = removeVar(source, 'templateIterator'); source = removeSupportNonEnumShadows(source); source = removeSupportEnumPrototypes(source); diff --git a/build/pre-compile.js b/build/pre-compile.js index 5b6388ded..6c45fcc27 100644 --- a/build/pre-compile.js +++ b/build/pre-compile.js @@ -265,17 +265,17 @@ source = source.replace("result[length]['value']", 'result[length].value'); // remove whitespace from string literals - source = source.replace(/^([ "'\w]+:)? *"[^"\\\n]*(?:\\.[^"\\\n]*)*"|'[^'\\\n]*(?:\\.[^'\\\n]*)*'/gm, function(string, captured) { - // remove object literal property name - if (/:$/.test(captured)) { - string = string.slice(captured.length); + source = source.replace(/^((?:[ "'\w]+:)? *)"[^"\\\n]*(?:\\.[^"\\\n]*)*"|'[^'\\\n]*(?:\\.[^'\\\n]*)*'/gm, function(string, left) { + // clip after an object literal property name or leading spaces + if (left) { + string = string.slice(left.length); } // avoids removing the '\n' of the `stringEscapes` object string = string.replace(/\[object |delete |else (?!{)|function | in |return\s+[\w"']|throw |typeof |use strict|var |@ |(["'])\\n\1|\\\\n|\\n|\s+/g, function(match) { return match == false || match == '\\n' ? '' : match; }); - // prepend object literal property name - return (captured || '') + string; + // unclip + return (left || '') + string; }); // remove whitespace from `_.template` related regexes @@ -328,7 +328,7 @@ // match the `iteratorTemplate` '( +)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}', // match methods created by `createIterator` calls - 'createIterator\\((?:{|[a-zA-Z]+)[\\s\\S]+?\\);\\n', + 'createIterator\\((?:{|[a-zA-Z]+)[\\s\\S]*?\\);\\n', // match variables storing `createIterator` options '( +)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\2}', // match the the `createIterator` function @@ -351,14 +351,6 @@ return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']"; }); - if (isCreateIterator) { - // clip before the `factory` call to avoid minifying its arguments - source = source.replace(snippet, function() { - return modified; - }); - - snippet = modified = modified.replace(/return factory\([\s\S]+$/, ''); - } // minify `createIterator` option property names iteratorOptions.forEach(function(property, index) { var minName = minNames[index]; @@ -370,15 +362,20 @@ }); // minify snippet variables / arguments - compiledVars.forEach(function(variable, index) { + compiledVars.forEach(function(varName, index) { var minName = minNames[index]; + // minify variable names present in strings + if (isCreateIterator) { + modified = modified.replace(RegExp('(([\'"])[^\\n\\2]*?)\\b' + varName + '\\b(?=[^\\n\\2]*\\2[ ,+]+$)', 'gm'), '$1' + minName); + } // ensure properties in compiled strings aren't minified - modified = modified.replace(RegExp('([^.]\\b)' + variable + '\\b(?!\' *[\\]:])', 'g'), '$1' + minName); - + else { + modified = modified.replace(RegExp('([^.])\\b' + varName + '\\b(?!\' *[\\]:])', 'g'), '$1' + minName); + } // correct `typeof` values - if (/^(?:boolean|function|object|number|string|undefined)$/.test(variable)) { - modified = modified.replace(RegExp("(typeof [^']+')" + minName + "'", 'g'), '$1' + variable + "'"); + if (/^(?:boolean|function|object|number|string|undefined)$/.test(varName)) { + modified = modified.replace(RegExp("(typeof [^']+')" + minName + "'", 'g'), '$1' + varName + "'"); } }); diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index 18d2c7f4b..67c66a7dd 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -4,43 +4,43 @@ * Build: `lodash -o ./dist/lodash.compat.js` * Underscore.js 1.4.4 underscorejs.org/LICENSE */ -;(function(n){function t(r){function a(n){return n&&typeof n=="object"&&!ve(n)&&Jt.call(n,"__wrapped__")?n:new V(n)}function R(n,t,e){var r=n.length,u=r-t>=e;if(u){var a={};for(e=t-1;++et||typeof n=="undefined")return 1;if(nu;u++)r+="i='"+t.g[u]+"';if(","constructor"==t.g[u]&&(r+="!(f&&f.prototype===m)&&"),r+="h.call(m,i)){"+t.f+"}"}return(t.b||le.nonEnumArgs)&&(r+="}"),r+=t.c+";return u",e("h,j,k,l,o,p,r","return function("+n+"){"+r+"}")(Jt,W,ve,ut,ge,a,q)}function K(n){return"\\"+B[n]}function M(n){return he[n]}function U(n){return typeof n.toString!="function"&&typeof Tt=="string"(n)}function V(n){this.__wrapped__=n}function G(){}function H(n){var t=!1;if(!n||Yt.call(n)!=I||!le.argsClass&&j(n))return t; -var e=n.constructor;return!tt(e)&&(le.nodeClass||!U(n))||e instanceof e?le.ownLast?(be(n,function(n,e,r){return t=h.call(r,e),!1}),!0===St):(be(n,function(n,t){St=t}),!1===St||Jt.call(n,St)):St}function J(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=It(0>e?0:e);++re?ue(0,u+e):e)||0,typeof u=="number"?a=-1<(ut(n)?n.indexOf(t,e):bt(n,t,e)):pe(n,function(n){return++ru&&(u=i)}}else t=!t&&ut(n)?T:a.createCallback(t,e),pe(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)});return u}function gt(n,t,e,r){var u=3>arguments.length;if(t=a.createCallback(t,r,4),ve(n)){var o=-1,i=n.length;for(u&&(e=n[++o]);++oarguments.length;if(typeof o!="number")var f=ge(n),o=f.length;else le.unindexedChars&&ut(n)&&(u=n.split(""));return t=a.createCallback(t,r,4),pt(n,function(n,r,a){r=f?f[--o]:--o,e=i?(i=!1,u[r]):t(e,u[r],r,a)}),e}function yt(n,t,e){var r;if(t=a.createCallback(t,e),ve(n)){e=-1;for(var u=n.length;++ee?ue(0,u+e):e||0)-1;else if(e)return r=Ct(n,t),n[r]===t?r:-1;for(;++r>>1,e(n[r])bt(f,p))&&((e||c)&&f.push(p),i.push(r)) -}return i}function jt(n,t){for(var e=-1,r=n?n.length:0,u={};++e/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:y,variable:"",imports:{_:a}};var Pt={a:"q,w,g",h:"var a=arguments,b=0,c=typeof g=='number'?2:a.length;while(++b":">",'"':""","'":"'"},ye=Z(he),me=L(Pt,{h:Pt.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=p.createCallback(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),f:"u[i]=d?d(u[i],m[i]):m[i]"}),de=L(Pt),be=L(Bt,qt,{i:!1}),_e=L(Bt,qt); -tt(/x/)&&(tt=function(n){return n instanceof $t||Yt.call(n)==S});var Ce=Ht?function(n){if(!n||Yt.call(n)!=I||!le.argsClass&&W(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=Ht(t))&&Ht(e);return e?n==e||Ht(n)==e:H(n)}:H;return fe&&u&&typeof Wt=="function"&&(xt=kt(Wt,r)),Wt=8==oe("08")?oe:function(n,t){return oe(ut(n)?n.replace(m,""):n,t||0)},a.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},a.assign=me,a.at=function(n){var t=-1,e=Vt.apply(Dt,J(arguments,1)),r=e.length,u=It(r); -for(le.unindexedChars&&ut(n)&&(n=n.split(""));++tbt(f,c)){o&&f.push(c);for(var p=e;--p;)if(!(r[p]||(r[p]=R(t[p],0,100)))(c))continue n;i.push(c)}}return i},a.invert=Z,a.invoke=function(n,t){var e=J(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=It(typeof a=="number"?a:0);return pt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},a.keys=ge,a.map=st,a.max=vt,a.memoize=function(n,t){var e={};return function(){var r=Tt(t?t.apply(this,arguments):arguments[0]);return Jt.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},a.merge=at,a.min=function(n,t,e){var r=1/0,u=r; -if(!t&&ve(n)){e=-1;for(var o=n.length;++ebt(o,e,1))&&(u[e]=n)}),u},a.once=function(n){var t,e;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},a.pairs=function(n){for(var t=-1,e=ge(n),r=e.length,u=It(r);++te?ue(0,r+e):ae(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},a.mixin=Et,a.noConflict=function(){return r._=Lt,this},a.parseInt=Wt,a.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+Gt(ie()*((+t||0)-n+1))},a.reduce=gt,a.reduceRight=ht,a.result=St,a.runInContext=t,a.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:ge(n).length},a.some=yt,a.sortedIndex=Ct,a.template=function(n,t,r){var u=a.templateSettings;n||(n=""),r=de({},r,u); -var o,i=de({},r.imports,u.imports),u=ge(i),i=ot(i),f=0,s=r.interpolate||d,g="__p+='",s=Rt((r.escape||d).source+"|"+s.source+"|"+(s===y?v:d).source+"|"+(r.evaluate||d).source+"|$","g");n.replace(s,function(t,e,r,u,a,i){return r||(r=u),g+=n.slice(f,i).replace(_,K),e&&(g+="'+__e("+e+")+'"),a&&(o=!0,g+="';"+a+";__p+='"),r&&(g+="'+((__t=("+r+"))==null?'':__t)+'"),f=i+t.length,t}),g+="';\n",s=r=r.variable,s||(r="obj",g="with("+r+"){"+g+"}"),g=(o?g.replace(c,""):g).replace(l,"$1").replace(p,"$1;"),g="function("+r+"){"+(s?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+g+"return __p}"; -try{var h=$t(u,"return "+g).apply(e,i)}catch(m){throw m.source=g,m}return t?h(t):(h.source=g,h)},a.unescape=function(n){return null==n?"":Tt(n).replace(s,Q)},a.uniqueId=function(n){var t=++i;return Tt(null==n?"":n)+t},a.all=ft,a.any=yt,a.detect=lt,a.foldl=gt,a.foldr=ht,a.include=it,a.inject=gt,_e(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(){var t=[this.__wrapped__];return Qt.apply(t,arguments),n.apply(a,t)})}),a.first=mt,a.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u; -for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[u-1];return J(n,ue(0,u-r))}},a.take=mt,a.head=mt,_e(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return null==t||e&&typeof t!="function"?r:new V(r)})}),a.VERSION="1.0.1",a.prototype.toString=function(){return Tt(this.__wrapped__)},a.prototype.value=At,a.prototype.valueOf=At,pe(["join","pop","shift"],function(n){var t=Dt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments) -}}),pe(["push","reverse","sort","unshift"],function(n){var t=Dt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),pe(["concat","slice","splice"],function(n){var t=Dt[n];a.prototype[n]=function(){return new V(t.apply(this.__wrapped__,arguments))}}),le.spliceObjects||pe(["pop","shift","splice"],function(n){var t=Dt[n],e="splice"==n;a.prototype[n]=function(){var n=this.__wrapped__,r=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new V(r):r}}),a}var e,r=typeof exports=="object"&&exports,u=typeof module=="object"&&module&&module.exports==r&&module,a=typeof global=="object"&&global; -a.global===a&&(n=a);var i=0,f={},c=/\b__p\+='';/g,l=/\b(__p\+=)''\+/g,p=/(__e\(.*?\)|\b__t\))\+'';/g,s=/&(?:amp|lt|gt|quot|#39);/g,v=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,g=/\w*$/,y=/<%=([\s\S]+?)%>/g,m=/^0+(?=.$)/,d=/($^)/,b=/[&<>"']/g,_=/['\n\r\t\u2028\u2029\\]/g,C="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),w="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),k="[object Arguments]",x="[object Array]",O="[object Boolean]",E="[object Date]",S="[object Function]",A="[object Number]",I="[object Object]",P="[object RegExp]",N="[object String]",$={}; -$[S]=!1,$[k]=$[x]=$[O]=$[E]=$[A]=$[I]=$[P]=$[N]=!0;var q={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},B={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},F=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=F,define(function(){return F})):r&&!r.nodeType?u?(u.exports=F)._=F:r._=F:n._=F})(this); \ No newline at end of file +;(function(n){function t(r){function a(n){return n&&typeof n=="object"&&!ce(n)&&Ut.call(n,"__wrapped__")?n:new K(n)}function q(n,t,e){var r=n.length,u=r-t>=e;if(u){var a={};for(e=t-1;++et||typeof n=="undefined")return 1;if(nu;u++)r+="i='"+t.g[u]+"';if(","constructor"==t.g[u]&&(r+="!(f&&f.prototype===m)&&"),r+="h.call(m,i)){"+t.f+"}"}return(t.b||oe.nonEnumArgs)&&(r+="}"),r+=t.c+";return u",e("h,j,k,l,o,p,r","return function("+n+"){"+r+"}")(Ut,H,ce,tt,le,a,P)}function D(n){return"\\"+N[n]}function z(n){return pe[n]}function L(n){return typeof n.toString!="function"&&typeof qt=="string"(n)}function K(n){this.__wrapped__=n}function M(){}function U(n){var t=!1;if(!n||Jt.call(n)!=E||!oe.argsClass&&H(n))return t; +var e=n.constructor;return!Y(e)&&(oe.nodeClass||!L(n))||e instanceof e?oe.ownLast?(he(n,function(n,e,r){return t=Ut.call(r,e),!1}),!0===t):(he(n,function(n,e){t=e}),!1===t||Ut.call(n,t)):t}function V(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Ot(0>e?0:e);++re?ne(0,u+e):e)||0,typeof u=="number"?a=-1<(tt(n)?n.indexOf(t,e):yt(n,t,e)):ie(n,function(n){return++ru&&(u=i)}}else t=!t&&tt(n)?B:a.createCallback(t,e),ie(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)});return u}function pt(n,t,e,r){var u=3>arguments.length;if(t=a.createCallback(t,r,4),ce(n)){var o=-1,i=n.length;for(u&&(e=n[++o]);++oarguments.length;if(typeof o!="number")var f=le(n),o=f.length;else oe.unindexedChars&&tt(n)&&(u=n.split(""));return t=a.createCallback(t,r,4),ft(n,function(n,r,a){r=f?f[--o]:--o,e=i?(i=!1,u[r]):t(e,u[r],r,a)}),e}function vt(n,t,e){var r;if(t=a.createCallback(t,e),ce(n)){e=-1;for(var u=n.length;++ee?ne(0,u+e):e||0)-1;else if(e)return r=dt(n,t),n[r]===t?r:-1;for(;++r>>1,e(n[r])yt(f,p))&&((e||c)&&f.push(p),i.push(r)) +}return i}function _t(n,t){for(var e=-1,r=n?n.length:0,u={};++e/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:g,variable:"",imports:{_:a}};var Et={a:"q,w,g",h:"var a=arguments,b=0,c=typeof g=='number'?2:a.length;while(++b":">",'"':""","'":"'"},se=W(pe),ve=T(Et,{h:Et.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=p.createCallback(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),f:"u[i]=d?d(u[i],m[i]):m[i]"}),ge=T(Et),he=T(Pt,It,{i:!1}),ye=T(Pt,It); +Y(/x/)&&(Y=function(n){return n instanceof At||Jt.call(n)==x});var me=Mt?function(n){if(!n||Jt.call(n)!=E||!oe.argsClass&&H(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=Mt(t))&&Mt(e);return e?n==e||Mt(n)==e:U(n)}:U;return ue&&u&&typeof Gt=="function"&&(wt=Ct(Gt,r)),Gt=8==ee("08")?ee:function(n,t){return ee(tt(n)?n.replace(h,""):n,t||0)},a.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},a.assign=ve,a.at=function(n){var t=-1,e=Lt.apply(Bt,V(arguments,1)),r=e.length,u=Ot(r); +for(oe.unindexedChars&&tt(n)&&(n=n.split(""));++tyt(f,c)){o&&f.push(c);for(var p=e;--p;)if(!(r[p]||(r[p]=q(t[p],0,100)))(c))continue n;i.push(c)}}return i},a.invert=W,a.invoke=function(n,t){var e=V(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Ot(typeof a=="number"?a:0);return ft(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},a.keys=le,a.map=ct,a.max=lt,a.memoize=function(n,t){var e={};return function(){var r=qt(t?t.apply(this,arguments):arguments[0]);return Ut.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},a.merge=et,a.min=function(n,t,e){var r=1/0,u=r; +if(!t&&ce(n)){e=-1;for(var o=n.length;++eyt(o,e,1))&&(u[e]=n)}),u},a.once=function(n){var t,e;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},a.pairs=function(n){for(var t=-1,e=le(n),r=e.length,u=Ot(r);++te?ne(0,r+e):te(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},a.mixin=kt,a.noConflict=function(){return r._=Rt,this},a.parseInt=Gt,a.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+Kt(re()*((+t||0)-n+1))},a.reduce=pt,a.reduceRight=st,a.result=function(n,t){var r=n?n[t]:e;return Y(r)?n[t]():r},a.runInContext=t,a.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:le(n).length},a.some=vt,a.sortedIndex=dt,a.template=function(n,t,r){var u=a.templateSettings; +n||(n=""),r=ge({},r,u);var o,i=ge({},r.imports,u.imports),u=le(i),i=rt(i),p=0,v=r.interpolate||y,h="__p+='",v=$t((r.escape||y).source+"|"+v.source+"|"+(v===g?s:y).source+"|"+(r.evaluate||y).source+"|$","g");n.replace(v,function(t,e,r,u,a,i){return r||(r=u),h+=n.slice(p,i).replace(d,D),e&&(h+="'+__e("+e+")+'"),a&&(o=!0,h+="';"+a+";__p+='"),r&&(h+="'+((__t=("+r+"))==null?'':__t)+'"),p=i+t.length,t}),h+="';\n",v=r=r.variable,v||(r="obj",h="with("+r+"){"+h+"}"),h=(o?h.replace(f,""):h).replace(c,"$1").replace(l,"$1;"),h="function("+r+"){"+(v?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+h+"return __p}"; +try{var m=At(u,"return "+h).apply(e,i)}catch(b){throw b.source=h,b}return t?m(t):(m.source=h,m)},a.unescape=function(n){return null==n?"":qt(n).replace(p,G)},a.uniqueId=function(n){var t=++o;return qt(null==n?"":n)+t},a.all=at,a.any=vt,a.detect=it,a.foldl=pt,a.foldr=st,a.include=ut,a.inject=pt,ye(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(){var t=[this.__wrapped__];return Vt.apply(t,arguments),n.apply(a,t)})}),a.first=gt,a.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u; +for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[u-1];return V(n,ne(0,u-r))}},a.take=gt,a.head=gt,ye(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return null==t||e&&typeof t!="function"?r:new K(r)})}),a.VERSION="1.0.1",a.prototype.toString=function(){return qt(this.__wrapped__)},a.prototype.value=xt,a.prototype.valueOf=xt,ie(["join","pop","shift"],function(n){var t=Bt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments) +}}),ie(["push","reverse","sort","unshift"],function(n){var t=Bt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),ie(["concat","slice","splice"],function(n){var t=Bt[n];a.prototype[n]=function(){return new K(t.apply(this.__wrapped__,arguments))}}),oe.spliceObjects||ie(["pop","shift","splice"],function(n){var t=Bt[n],e="splice"==n;a.prototype[n]=function(){var n=this.__wrapped__,r=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new K(r):r}}),a}var e,r=typeof exports=="object"&&exports,u=typeof module=="object"&&module&&module.exports==r&&module,a=typeof global=="object"&&global; +a.global===a&&(n=a);var o=0,i={},f=/\b__p\+='';/g,c=/\b(__p\+=)''\+/g,l=/(__e\(.*?\)|\b__t\))\+'';/g,p=/&(?:amp|lt|gt|quot|#39);/g,s=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,v=/\w*$/,g=/<%=([\s\S]+?)%>/g,h=/^0+(?=.$)/,y=/($^)/,m=/[&<>"']/g,d=/['\n\r\t\u2028\u2029\\]/g,b="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),C="[object Arguments]",w="[object Array]",j="[object Boolean]",k="[object Date]",x="[object Function]",O="[object Number]",E="[object Object]",S="[object RegExp]",A="[object String]",I={}; +I[x]=!1,I[C]=I[w]=I[j]=I[k]=I[O]=I[E]=I[S]=I[A]=!0;var P={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},N={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},$=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=$,define(function(){return $})):r&&!r.nodeType?u?(u.exports=$)._=$:r._=$:n._=$})(this); \ No newline at end of file diff --git a/dist/lodash.min.js b/dist/lodash.min.js index a3e5b9888..02dcebc93 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -4,39 +4,38 @@ * Build: `lodash modern -o ./dist/lodash.js` * Underscore.js 1.4.4 underscorejs.org/LICENSE */ -;(function(n){function t(i){function c(n){if(!n||Wt.call(n)!=S)return a;var t=n.valueOf,e=typeof t=="function"&&(e=Gt(t))&&Gt(e);return e?n==e||Gt(n)==e:H(n)}function R(n){return n&&typeof n=="object"&&!fe(n)&&Ht.call(n,"__wrapped__")?n:new V(n)}function T(n,t,e){var r=n.length,u=r-t>=e;if(u){var a={};for(e=t-1;++et||typeof n=="undefined")return 1;if(ne?0:e);++re?ee(0,u+e):e)||0,typeof u=="number"?o=-1<(rt(n)?n.indexOf(t,e):bt(n,t,e)):he(n,function(n){return++ru&&(u=o) -}}else t=!t&&rt(n)?D:R.createCallback(t,e),lt(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)});return u}function vt(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=R.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++oarguments.length;if(typeof u!="number")var i=ce(n),u=i.length;return t=R.createCallback(t,r,4),lt(n,function(r,f,c){f=i?i[--u]:--u,e=o?(o=a,n[f]):t(e,n[f],f,c) -}),e}function ht(n,t,e){var r;t=R.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++ee?ee(0,u+e):e||0)-1;else if(e)return r=_t(n,t),n[r]===t?r:-1;for(;++r>>1,e(n[r])bt(c,s))&&((e||l)&&c.push(s),f.push(r))}return f}function jt(n,t){for(var e=-1,r=n?n.length:0,u={};++e/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:b,variable:"",imports:{_:R}},St={a:"q,w,g",h:"var a=arguments,b=0,c=typeof g=='number'?2:a.length;while(++b":">",'"':""","'":"'"},pe=Y(le),se=K(St,{h:St.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=p.createCallback(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),f:"u[i]=d?d(u[i],m[i]):m[i]"}),ve=K(St),ge=K(qt,Bt,{i:a}),he=K(qt,Bt);return $t&&f&&typeof Lt=="function"&&(Ct=wt(Lt,i)),Lt=8==ue("08")?ue:function(n,t){return ue(rt(n)?n.replace(d,""):n,t||0) -},R.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},R.assign=se,R.at=function(n){for(var t=-1,e=Ut.apply(Tt,J(arguments,1)),r=e.length,u=Nt(r);++tbt(f,c)){o&&f.push(c);for(var p=e;--p;)if(!(r[p]||(r[p]=T(t[p],0,100)))(c))continue n;i.push(c)}}return i},R.invert=Y,R.invoke=function(n,t){var e=J(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Nt(typeof a=="number"?a:0);return lt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},R.keys=ce,R.map=pt,R.max=st,R.memoize=function(n,t){var e={};return function(){var r=Rt(t?t.apply(this,arguments):arguments[0]); -return Ht.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},R.merge=ut,R.min=function(n,t,e){var r=1/0,u=r;if(!t&&fe(n)){e=-1;for(var a=n.length;++ebt(a,e,1))&&(u[e]=n)}),u},R.once=function(n){var t,e;return function(){return t?e:(t=r,e=n.apply(this,arguments),n=u,e) -}},R.pairs=function(n){for(var t=-1,e=ce(n),r=e.length,u=Nt(r);++te?ee(0,r+e):re(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},R.mixin=Ot,R.noConflict=function(){return i._=zt,this},R.parseInt=Lt,R.random=function(n,t){return n==u&&t==u&&(t=1),n=+n||0,t==u&&(t=n,n=0),n+Vt(ae()*((+t||0)-n+1))},R.reduce=vt,R.reduceRight=gt,R.result=function(n,t){var r=n?n[t]:e;return nt(r)?n[t]():r},R.runInContext=t,R.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:ce(n).length},R.some=ht,R.sortedIndex=_t,R.template=function(n,t,u){var a=R.templateSettings; -n||(n=""),u=ve({},u,a);var o,i=ve({},u.imports,a.imports),a=ce(i),i=at(i),f=0,c=u.interpolate||_,l="__p+='",c=Ft((u.escape||_).source+"|"+c.source+"|"+(c===b?y:_).source+"|"+(u.evaluate||_).source+"|$","g");n.replace(c,function(t,e,u,a,i,c){return u||(u=a),l+=n.slice(f,c).replace(j,M),e&&(l+="'+__e("+e+")+'"),i&&(o=r,l+="';"+i+";__p+='"),u&&(l+="'+((__t=("+u+"))==null?'':__t)+'"),f=c+t.length,t}),l+="';\n",c=u=u.variable,c||(u="obj",l="with("+u+"){"+l+"}"),l=(o?l.replace(s,""):l).replace(v,"$1").replace(g,"$1;"),l="function("+u+"){"+(c?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}"; -try{var p=Et(a,"return "+l).apply(e,i)}catch(h){throw h.source=l,h}return t?p(t):(p.source=l,p)},R.unescape=function(n){return n==u?"":Rt(n).replace(h,L)},R.uniqueId=function(n){var t=++l;return Rt(n==u?"":n)+t},R.all=it,R.any=ht,R.detect=ct,R.foldl=vt,R.foldr=gt,R.include=ot,R.inject=vt,he(R,function(n,t){R.prototype[t]||(R.prototype[t]=function(){var t=[this.__wrapped__];return Jt.apply(t,arguments),n.apply(R,t)})}),R.first=yt,R.last=function(n,t,e){if(n){var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=a; -for(t=R.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,r==u||e)return n[a-1];return J(n,ee(0,a-r))}},R.take=yt,R.head=yt,he(R,function(n,t){R.prototype[t]||(R.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return t==u||e&&typeof t!="function"?r:new V(r)})}),R.VERSION="1.0.1",R.prototype.toString=function(){return Rt(this.__wrapped__)},R.prototype.value=It,R.prototype.valueOf=It,lt(["join","pop","shift"],function(n){var t=Tt[n];R.prototype[n]=function(){return t.apply(this.__wrapped__,arguments) -}}),lt(["push","reverse","sort","unshift"],function(n){var t=Tt[n];R.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),lt(["concat","slice","splice"],function(n){var t=Tt[n];R.prototype[n]=function(){return new V(t.apply(this.__wrapped__,arguments))}}),R}var e,r=!0,u=null,a=!1,i=typeof exports=="object"&&exports,f=typeof module=="object"&&module&&module.exports==i&&module,c=typeof global=="object"&&global;c.global===c&&(n=c);var l=0,p={},s=/\b__p\+='';/g,v=/\b(__p\+=)''\+/g,g=/(__e\(.*?\)|\b__t\))\+'';/g,h=/&(?:amp|lt|gt|quot|#39);/g,y=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,m=/\w*$/,b=/<%=([\s\S]+?)%>/g,d=/^0+(?=.$)/,_=/($^)/,k=/[&<>"']/g,j=/['\n\r\t\u2028\u2029\\]/g,w="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),C="[object Arguments]",x="[object Array]",O="[object Boolean]",I="[object Date]",N="[object Number]",S="[object Object]",A="[object RegExp]",E="[object String]",$={"[object Function]":a}; -$[C]=$[x]=$[O]=$[I]=$[N]=$[S]=$[A]=$[E]=r;var q={"boolean":a,"function":r,object:r,number:a,string:a,undefined:a},B={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},F=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=F,define(function(){return F})):i&&!i.nodeType?f?(f.exports=F)._=F:i._=F:n._=F})(this); \ No newline at end of file +;(function(n){function t(r){function a(n){return n&&typeof n=="object"&&!re(n)&&Kt.call(n,"__wrapped__")?n:new z(n)}function $(n,t,e){var r=n.length,u=r-t>=e;if(u){var a={};for(e=t-1;++et||typeof n=="undefined")return 1;if(ne?0:e);++re?Xt(0,u+e):e)||0,typeof u=="number"?a=-1<(Y(n)?n.indexOf(t,e):vt(n,t,e)):le(n,function(n){return++ru&&(u=i) +}}else t=!t&&Y(n)?q:a.createCallback(t,e),at(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)});return u}function ft(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=a.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++oarguments.length;if(typeof u!="number")var i=ue(n),u=i.length;return t=a.createCallback(t,r,4),at(n,function(r,a,f){a=i?i[--u]:--u,e=o?(o=!1,n[a]):t(e,n[a],a,f) +}),e}function lt(n,t,e){var r;t=a.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++ee?Xt(0,u+e):e||0)-1;else if(e)return r=ht(n,t),n[r]===t?r:-1;for(;++r>>1,e(n[r])vt(f,p))&&((e||c)&&f.push(p),i.push(r))}return i}function mt(n,t){for(var e=-1,r=n?n.length:0,u={};++e/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:g,variable:"",imports:{_:a}},Ct={a:"q,w,g",h:"var a=arguments,b=0,c=typeof g=='number'?2:a.length;while(++b":">",'"':""","'":"'"},oe=J(ae),ie=R(Ct,{h:Ct.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=p.createCallback(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),f:"u[i]=d?d(u[i],m[i]):m[i]"}),fe=R(Ct),ce=R(Nt,St,{i:!1}),le=R(Nt,St),pe=function(n){if(!n||Gt.call(n)!=x)return!1; +var t=n.valueOf,e=typeof t=="function"&&(e=Pt(t))&&Pt(e);return e?n==e||Pt(n)==e:K(n)};return It&&u&&typeof Ut=="function"&&(dt=bt(Ut,r)),Ut=8==Zt("08")?Zt:function(n,t){return Zt(Y(n)?n.replace(h,""):n,t||0)},a.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},a.assign=ie,a.at=function(n){for(var t=-1,e=Dt.apply($t,M(arguments,1)),r=e.length,u=wt(r);++tvt(f,c)){o&&f.push(c);for(var p=e;--p;)if(!(r[p]||(r[p]=$(t[p],0,100)))(c))continue n;i.push(c)}}return i},a.invert=J,a.invoke=function(n,t){var e=M(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=wt(typeof a=="number"?a:0); +return at(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},a.keys=ue,a.map=ot,a.max=it,a.memoize=function(n,t){var e={};return function(){var r=Et(t?t.apply(this,arguments):arguments[0]);return Kt.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},a.merge=Z,a.min=function(n,t,e){var r=1/0,u=r;if(!t&&re(n)){e=-1;for(var o=n.length;++evt(o,e,1))&&(u[e]=n)}),u},a.once=function(n){var t,e;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},a.pairs=function(n){for(var t=-1,e=ue(n),r=e.length,u=wt(r);++te?Xt(0,r+e):Yt(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},a.mixin=kt,a.noConflict=function(){return r._=Bt,this},a.parseInt=Ut,a.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+zt(ne()*((+t||0)-n+1))},a.reduce=ft,a.reduceRight=ct,a.result=function(n,t){var r=n?n[t]:e;return Q(r)?n[t]():r},a.runInContext=t,a.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:ue(n).length +},a.some=lt,a.sortedIndex=ht,a.template=function(n,t,r){var u=a.templateSettings;n||(n=""),r=fe({},r,u);var o,i=fe({},r.imports,u.imports),u=ue(i),i=nt(i),p=0,v=r.interpolate||y,h="__p+='",v=At((r.escape||y).source+"|"+v.source+"|"+(v===g?s:y).source+"|"+(r.evaluate||y).source+"|$","g");n.replace(v,function(t,e,r,u,a,i){return r||(r=u),h+=n.slice(p,i).replace(b,T),e&&(h+="'+__e("+e+")+'"),a&&(o=!0,h+="';"+a+";__p+='"),r&&(h+="'+((__t=("+r+"))==null?'':__t)+'"),p=i+t.length,t}),h+="';\n",v=r=r.variable,v||(r="obj",h="with("+r+"){"+h+"}"),h=(o?h.replace(f,""):h).replace(c,"$1").replace(l,"$1;"),h="function("+r+"){"+(v?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+h+"return __p}"; +try{var m=Ot(u,"return "+h).apply(e,i)}catch(d){throw d.source=h,d}return t?m(t):(m.source=h,m)},a.unescape=function(n){return null==n?"":Et(n).replace(p,U)},a.uniqueId=function(n){var t=++o;return Et(null==n?"":n)+t},a.all=et,a.any=lt,a.detect=ut,a.foldl=ft,a.foldr=ct,a.include=tt,a.inject=ft,le(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(){var t=[this.__wrapped__];return Mt.apply(t,arguments),n.apply(a,t)})}),a.first=pt,a.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u; +for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[u-1];return M(n,Xt(0,u-r))}},a.take=pt,a.head=pt,le(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return null==t||e&&typeof t!="function"?r:new z(r)})}),a.VERSION="1.0.1",a.prototype.toString=function(){return Et(this.__wrapped__)},a.prototype.value=jt,a.prototype.valueOf=jt,at(["join","pop","shift"],function(n){var t=$t[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments) +}}),at(["push","reverse","sort","unshift"],function(n){var t=$t[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),at(["concat","slice","splice"],function(n){var t=$t[n];a.prototype[n]=function(){return new z(t.apply(this.__wrapped__,arguments))}}),a}var e,r=typeof exports=="object"&&exports,u=typeof module=="object"&&module&&module.exports==r&&module,a=typeof global=="object"&&global;a.global===a&&(n=a);var o=0,i={},f=/\b__p\+='';/g,c=/\b(__p\+=)''\+/g,l=/(__e\(.*?\)|\b__t\))\+'';/g,p=/&(?:amp|lt|gt|quot|#39);/g,s=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,v=/\w*$/,g=/<%=([\s\S]+?)%>/g,h=/^0+(?=.$)/,y=/($^)/,m=/[&<>"']/g,b=/['\n\r\t\u2028\u2029\\]/g,d="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),_="[object Arguments]",k="[object Array]",j="[object Boolean]",w="[object Date]",C="[object Number]",x="[object Object]",O="[object RegExp]",I="[object String]",N={"[object Function]":!1}; +N[_]=N[k]=N[j]=N[w]=N[C]=N[x]=N[O]=N[I]=!0;var S={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},A={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},E=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=E,define(function(){return E})):r&&!r.nodeType?u?(u.exports=E)._=E:r._=E:n._=E})(this); \ No newline at end of file