diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 859f57abd..81567ec89 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -926,7 +926,7 @@ var conditions = []; if (support.enumPrototypes) { conditions.push('!(skipProto && index == "prototype")'); } if (support.enumErrorProps) { conditions.push('!(skipErrorProps && (index == "message" || index == "name"))'); } if (obj.useHas && obj.keys) { - __p += '\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] && keys(iterable),\n length = ownProps ? ownProps.length : 0;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n'; + __p += '\n var ownIndex = -1,\n ownProps = keys(iterable),\n length = ownProps.length;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n'; if (conditions.length) { __p += ' if (' + (conditions.join(' && ')) + @@ -1984,27 +1984,6 @@ 'loop': 'if (callback(iterable[index], index, collection) === false) return result' }; - /** Reusable iterator options for `assign` and `defaults` */ - var defaultsIteratorOptions = { - 'args': 'object, source, guard', - 'top': - 'var args = arguments,\n' + - ' argsIndex = 0,\n' + - " argsLength = typeof guard == 'number' ? 2 : args.length;\n" + - 'while (++argsIndex < argsLength) {\n' + - ' iterable = args[argsIndex];\n' + - ' if (iterable && objectTypes[typeof iterable]) {', - 'keys': keys, - 'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]", - 'bottom': ' }\n}' - }; - - /** Reusable iterator options for `forIn` and `forOwn` */ - var forOwnIteratorOptions = { - 'top': 'if (!objectTypes[typeof iterable]) return result;\n' + eachIteratorOptions.top, - 'array': false - }; - /** * Used to convert characters to HTML entities: * @@ -2076,18 +2055,31 @@ * defaults(object, { 'name': 'fred', 'employer': 'slate' }); * // => { 'name': 'barney', 'employer': 'slate' } */ - var assign = createIterator(defaultsIteratorOptions, { - 'top': - defaultsIteratorOptions.top.replace(';', - ';\n' + - "if (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n" + - ' var callback = baseCreateCallback(args[--argsLength - 1], args[argsLength--], 2);\n' + - "} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n" + - ' callback = args[--argsLength];\n' + - '}' - ), - 'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]' - }); + function assign(object, source, guard) { + var args = arguments, + argsIndex = 0, + argsLength = typeof guard == 'number' ? 2 : args.length; + + if (argsLength > 3 && typeof args[argsLength - 2] == 'function') { + var callback = baseCreateCallback(args[--argsLength - 1], args[argsLength--], 2); + } else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') { + callback = args[--argsLength]; + } + while (++argsIndex < argsLength) { + source = args[argsIndex]; + if (isObject(source)) { + var index = -1, + props = keys(source), + length = props.length; + + while (++index < length) { + var key = props[index]; + object[key] = callback ? callback(object[key], source[key]) : source[key]; + } + } + } + return object; + } /** * Creates a clone of `value`. If `isDeep` is `true` nested objects will also @@ -2241,7 +2233,28 @@ * _.defaults(object, { 'name': 'fred', 'employer': 'slate' }); * // => { 'name': 'barney', 'employer': 'slate' } */ - var defaults = createIterator(defaultsIteratorOptions); + function defaults(object, source, guard) { + var args = arguments, + argsIndex = 0, + argsLength = typeof guard == 'number' ? 2 : args.length; + + while (++argsIndex < argsLength) { + source = args[argsIndex]; + if (isObject(source)) { + var index = -1, + props = keys(source), + length = props.length; + + while (++index < length) { + var key = props[index]; + if (typeof object[key] == 'undefined') { + object[key] = source[key]; + } + } + } + } + return object; + } /** * This method is like `_.findIndex` except that it returns the key of the @@ -2380,7 +2393,9 @@ * }); * // => logs 'x', 'y', and 'move' (property order is not guaranteed across environments) */ - var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, { + var forIn = createIterator(eachIteratorOptions, { + 'top': 'if (!objectTypes[typeof iterable]) return result;\n' + eachIteratorOptions.top, + 'array': false, 'useHas': false }); @@ -2450,7 +2465,20 @@ * }); * // => logs '0', '1', and 'length' (property order is not guaranteed across environments) */ - var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions); + function forOwn(object, callback, thisArg) { + var index = -1, + props = keys(object), + length = props.length; + + callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); + while (++index < length) { + var key = props[index]; + if (callback(object[key], key, object) === false) { + break; + } + } + return object; + } /** * This method is like `_.forOwn` except that it iterates over elements diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index b340e6643..a44cde291 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -4,58 +4,59 @@ * Build: `lodash -o ./dist/lodash.compat.js` */ ;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++ei||typeof a=="undefined")return 1;if(ae?0:e);++r=_&&a===n,f=[];if(l){var c=o(r);c?(a=t,r=c):l=false}for(;++ua(r,c)&&f.push(c);return l&&p(r),f}function ot(n,t,e,r){r=(r||0)-1; -for(var u=n?n.length:0,o=[];++r=_&&l===n,h=u||g?i():s;for(g&&(h=o(h),l=t);++al(h,y))&&((u||g)&&h.push(y),s.push(v))}return g?(c(h.k),p(h)):u&&c(h),s}function ct(n){return function(t,e,r){var u={}; -if(e=v.createCallback(e,r,3),Ge(t)){r=-1;for(var o=t.length;++rk;k++)r+="n='"+e.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",e.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+e.g+"}"; -r+="}"}return(e.b||qe.nonEnumArgs)&&(r+="}"),r+=e.c+";return E",n("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",t+r+"}")(tt,W,pe,Ce,d,dt,Ge,Et,Q.f,se,X,We,M,ge,me)}function gt(n){return Qe[n]}function ht(){var t=(t=v.indexOf)===Wt?n:t;return t}function vt(n){return typeof n=="function"&&de.test(je.call(n))}function yt(n){var t,e;return!n||me.call(n)!=G||(t=n.constructor,xt(t)&&!(t instanceof t))||!qe.argsClass&&dt(n)||!qe.nodeClass&&f(n)?false:qe.ownLast?(rr(n,function(n,t,r){return e=Ce.call(r,t),false}),false!==e):(rr(n,function(n,t){e=t -}),typeof e=="undefined"||Ce.call(n,e))}function mt(n){return Xe[n]}function dt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&me.call(n)==F||false}function bt(n,t,e){var r=Me(n),u=r.length;for(t=tt(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function _t(n){var t=[];return rr(n,function(n,e){xt(n)&&t.push(e)}),t.sort()}function wt(n,t){for(var e=-1,r=Me(n),u=r.length,o={};++ee?Te(0,o+e):e)||0,Ge(n)?a=-1o&&(o=i)}}else t=null==t&&Et(n)?r:v.createCallback(t,e,3),nr(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Tt(n,t,e,r){var u=3>arguments.length;if(t=v.createCallback(t,r,4),Ge(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++oarguments.length;return t=v.createCallback(t,r,4),Rt(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function $t(n){var t=-1,e=n?n.length:0,r=ne(typeof e=="number"?e:0);return Nt(n,function(n){var e=lt(0,++t);r[t]=r[e],r[e]=n}),r}function Lt(n,t,e){var r;if(t=v.createCallback(t,e,3),Ge(n)){e=-1;for(var u=n.length;++er?Te(0,u+r):r||0}else if(r)return r=Kt(t,e),t[r]===e?r:-1;return n(t,e,r)}function qt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=v.createCallback(t,e,3);++u>>1,e(n[r])e?0:e);++t=h;m?(u&&(u=_e(u)),c=a,o=n.apply(i,r)):u||(u=Oe(y,h))}return m&&l?l=_e(l):l||t===p||(l=Oe(v,t)),e&&(m=true,o=n.apply(i,r)),!m||l||u||(r=i=null),o}}function Ut(n){return n}function Qt(n,t,e){var r=true,u=t&&_t(t);t&&(e||u.length)||(null==e&&(e=t),o=y,t=n,n=v,u=_t(t)),false===e?r=false:Ct(e)&&"chain"in e&&(r=e.chain);var o=n,a=xt(o);Nt(u,function(e){var u=n[e]=t[e];a&&(o.prototype[e]=function(){var t=this.__chain__,e=this.__wrapped__,a=[e]; -if(ke.apply(a,arguments),a=u.apply(n,a),r||t){if(e===a&&Ct(a))return this;a=new o(a),a.__chain__=t}return a})})}function Xt(){}function Yt(n){return function(t){return t[n]}}function Zt(){return this.__wrapped__}e=e?ut.defaults(Z.Object(),e,ut.pick(Z,P)):Z;var ne=e.Array,te=e.Boolean,ee=e.Date,re=e.Function,ue=e.Math,oe=e.Number,ae=e.Object,ie=e.RegExp,le=e.String,fe=e.TypeError,ce=[],pe=e.Error.prototype,se=ae.prototype,ge=le.prototype,he=e.window,ve=he&&he.document,ye=e._,me=se.toString,de=ie("^"+le(me).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),be=ue.ceil,_e=e.clearTimeout,we=ue.floor,je=re.prototype.toString,xe=vt(xe=ae.getPrototypeOf)&&xe,Ce=se.hasOwnProperty,ke=ce.push,Ee=se.propertyIsEnumerable,Oe=e.setTimeout,Se=ce.splice,Ae=ce.unshift,Ie=function(){try{var n={},t=vt(t=ae.defineProperty)&&t,e=t(n,n,n)&&t -}catch(r){}return e}(),De=vt(De=ae.create)&&De,Ne=vt(Ne=ne.isArray)&&Ne,Re=e.isFinite,Be=e.isNaN,Pe=vt(Pe=ae.keys)&&Pe,Te=ue.max,Fe=ue.min,$e=e.parseInt,Le=ue.random,ze={};ze[$]=ne,ze[L]=te,ze[z]=ee,ze[q]=re,ze[G]=ae,ze[K]=oe,ze[J]=ie,ze[M]=le;var We={};We[$]=We[z]=We[K]={constructor:true,toLocaleString:true,toString:true,valueOf:true},We[L]=We[M]={constructor:true,toString:true,valueOf:true},We[W]=We[q]=We[J]={constructor:true,toString:true},We[G]={constructor:true},function(){for(var n=T.length;n--;){var t,e=T[n]; -for(t in We)Ce.call(We,t)&&!Ce.call(We[t],e)&&(We[t][e]=false)}}(),y.prototype=v.prototype;var qe=v.support={};!function(){var n=function(){this.x=1},t={0:1,length:1},r=[];n.prototype={valueOf:1,y:1};for(var u in new n)r.push(u);for(u in arguments);qe.argsClass=me.call(arguments)==F,qe.argsObject=arguments.constructor==ae&&!(arguments instanceof ne),qe.dom=!!ve&&typeof ve=="object"&&de.test(_e)&&de.test(Oe),qe.enumErrorProps=Ee.call(pe,"message")||Ee.call(pe,"name"),qe.enumPrototypes=Ee.call(n,"prototype"),qe.funcDecomp=!vt(e.WinRTError)&&R.test(g),qe.funcNames=typeof re.name=="string",qe.nonEnumArgs=0!=u,qe.nonEnumShadows=!/valueOf/.test(r),qe.ownLast="x"!=r[0],qe.spliceObjects=(ce.splice.call(t,0,1),!t[0]),qe.unindexedChars="xx"!="x"[0]+ae("x")[0]; -try{qe.nodeClass=true}catch(o){qe.nodeClass=true}}(1),v.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:I,variable:"",imports:{_:v}},De||(nt=function(){function n(){}return function(t){if(Ct(t)){n.prototype=t;var r=new n;n.prototype=null}return r||e.Object()}}());var Ke=Ie?function(n,t){U.value=t,Ie(n,"__bindData__",U)}:Xt;qe.argsClass||(dt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ce.call(n,"callee")&&!Ee.call(n,"callee")||false});var Ge=Ne||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&me.call(n)==$||false -},Je=st({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),Me=Pe?function(n){return Ct(n)?qe.enumPrototypes&&typeof n=="function"||qe.nonEnumArgs&&n.length&&dt(n)?Je(n):Pe(n):[]}:Je,Ve={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:Me,g:"if(e(t[n],n,g)===false)return E"},He={a:"z,H,l",i:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b":">",'"':""","'":"'"},Xe=wt(Qe),Ye=ie("("+Me(Xe).join("|")+")","g"),Ze=ie("["+Me(Qe).join("")+"]","g"),nr=st(Ve),tr=st(He,{i:He.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var e=d(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){e=a[--c]}"),g:"E[n]=e?e(E[n],t[n]):t[n]"}),er=st(He),rr=st(Ve,Ue,{j:false}),ur=st(Ve,Ue); -qe.dom||(jt=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!or(n)||false}),xt(/x/)&&(xt=function(n){return typeof n=="function"&&me.call(n)==q});var or=xe?function(n){if(!n||me.call(n)!=G||!qe.argsClass&&dt(n))return false;var t=n.valueOf,e=vt(t)&&(e=xe(t))&&xe(e);return e?n==e||xe(n)==e:yt(n)}:yt,ar=ct(function(n,t,e){Ce.call(n,e)?n[e]++:n[e]=1}),ir=ct(function(n,t,e){(Ce.call(n,e)?n[e]:n[e]=[]).push(t)}),lr=ct(function(n,t,e){n[e]=t}),fr=Bt,cr=vt(cr=ee.now)&&cr||function(){return(new ee).getTime() -},pr=8==$e(j+"08")?$e:function(n,t){return $e(Et(n)?n.replace(D,""):n,t||0)};return v.after=function(n,t){if(!xt(t))throw new fe;return function(){return 1>--n?t.apply(this,arguments):void 0}},v.assign=tr,v.at=function(n){var t=arguments,e=-1,r=ot(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=ne(t);for(qe.unindexedChars&&Et(n)&&(n=n.split(""));++e=_&&o(r?e[r]:s))) -}var f=e[0],h=-1,v=f?f.length:0,y=[];n:for(;++h(m?t(m,g):l(s,g))){for(r=u,(m||s).push(g);--r;)if(m=a[r],0>(m?t(m,g):l(e[r],g)))continue n;y.push(g)}}for(;u--;)(m=a[u])&&p(m);return c(a),c(s),y},v.invert=wt,v.invoke=function(n,t){var e=s(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=ne(typeof o=="number"?o:0);return Nt(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},v.keys=Me,v.map=Bt,v.mapValues=function(n,t,e){var r={};return t=v.createCallback(t,e,3),ur(n,function(n,e,u){r[e]=t(n,e,u) -}),r},v.max=Pt,v.memoize=function(n,t){if(!xt(n))throw new fe;var e=function(){var r=e.cache,u=t?t.apply(this,arguments):b+arguments[0];return Ce.call(r,u)?r[u]:r[u]=n.apply(this,arguments)};return e.cache={},e},v.merge=function(n){var t=arguments,e=2;if(!Ct(n))return n;if("number"!=typeof t[2]&&(e=t.length),3e?Te(0,r+e):Fe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},v.mixin=Qt,v.noConflict=function(){return e._=ye,this},v.noop=Xt,v.now=cr,v.parseInt=pr,v.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Le(),Fe(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):lt(n,t) -},v.reduce=Tt,v.reduceRight=Ft,v.result=function(n,t){if(n){var e=n[t];return xt(e)?n[t]():e}},v.runInContext=g,v.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Me(n).length},v.some=Lt,v.sortedIndex=Kt,v.template=function(n,t,e){var r=v.templateSettings;n=le(n||""),e=er({},e,r);var u,o=er({},e.imports,r.imports),r=Me(o),o=Ot(o),i=0,l=e.interpolate||N,f="__p+='",l=ie((e.escape||N).source+"|"+l.source+"|"+(l===I?O:N).source+"|"+(e.evaluate||N).source+"|$","g");n.replace(l,function(t,e,r,o,l,c){return r||(r=o),f+=n.slice(i,c).replace(B,a),e&&(f+="'+__e("+e+")+'"),l&&(u=true,f+="';"+l+";\n__p+='"),r&&(f+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t -}),f+="';",l=e=e.variable,l||(e="obj",f="with("+e+"){"+f+"}"),f=(u?f.replace(x,""):f).replace(C,"$1").replace(E,"$1;"),f="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=re(r,"return "+f).apply(h,o)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},v.unescape=function(n){return null==n?"":(n=le(n),0>n.indexOf(";")?n:n.replace(Ye,mt))},v.uniqueId=function(n){var t=++m; -return le(null==n?"":n)+t},v.all=At,v.any=Lt,v.detect=Dt,v.findWhere=Dt,v.foldl=Tt,v.foldr=Ft,v.include=St,v.inject=Tt,Qt(function(){var n={};return ur(v,function(t,e){v.prototype[e]||(n[e]=t)}),n}(),false),v.first=zt,v.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,Te(0,u-r))},v.sample=function(n,t,e){return n&&typeof n.length!="number"?n=Ot(n):qe.unindexedChars&&Et(n)&&(n=n.split("")),null==t||e?n?n[lt(0,n.length-1)]:h:(n=$t(n),n.length=Fe(Te(0,t),n.length),n) -},v.take=zt,v.head=zt,ur(v,function(n,t){var e="sample"!==t;v.prototype[t]||(v.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new y(o,u):o})}),v.VERSION="2.4.1",v.prototype.chain=function(){return this.__chain__=true,this},v.prototype.toString=function(){return le(this.__wrapped__)},v.prototype.value=Zt,v.prototype.valueOf=Zt,nr(["join","pop","shift"],function(n){var t=ce[n];v.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments); -return n?new y(e,n):e}}),nr(["push","reverse","sort","unshift"],function(n){var t=ce[n];v.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),nr(["concat","slice","splice"],function(n){var t=ce[n];v.prototype[n]=function(){return new y(t.apply(this.__wrapped__,arguments),this.__chain__)}}),qe.spliceObjects||nr(["pop","shift","splice"],function(n){var t=ce[n],e="splice"==n;v.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,u=t.apply(r,arguments);return 0===r.length&&delete r[0],n||e?new y(u,n):u -}}),v}var h,v=[],y=[],m=0,d={},b=+new Date+"",_=75,w=40,j=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",x=/\b__p\+='';/g,C=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,O=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,S=/\w*$/,A=/^\s*function[ \n\r\t]+\w/,I=/<%=([\s\S]+?)%>/g,D=RegExp("^["+j+"]*0+(?=.$)"),N=/($^)/,R=/\bthis\b/,B=/['\n\r\t\u2028\u2029\\]/g,P="Array Boolean Date Error Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),T="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),F="[object Arguments]",$="[object Array]",L="[object Boolean]",z="[object Date]",W="[object Error]",q="[object Function]",K="[object Number]",G="[object Object]",J="[object RegExp]",M="[object String]",V={}; -V[q]=false,V[F]=V[$]=V[L]=V[z]=V[K]=V[G]=V[J]=V[M]=true;var H={leading:false,maxWait:0,trailing:false},U={configurable:false,enumerable:false,value:null,writable:false},Q={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:false},X={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Z=X[typeof window]&&!({toString:0}+"")||this,nt=X[typeof exports]&&exports&&!exports.nodeType&&exports,tt=X[typeof module]&&module&&!module.nodeType&&module,et=tt&&tt.exports===nt&&nt,rt=X[typeof global]&&global; +}}function r(n){return n.charCodeAt(0)}function u(n,t){for(var e=n.m,r=t.m,u=-1,o=e.length;++ui||typeof a=="undefined")return 1;if(ae?0:e);++r=_&&a===n,l=[];if(f){var c=o(r);c?(a=t,r=c):f=false}for(;++ua(r,c)&&l.push(c);return f&&p(r),l}function ot(n,t,e,r){r=(r||0)-1; +for(var u=n?n.length:0,o=[];++r=_&&f===n,h=u||g?i():s;for(g&&(h=o(h),f=t);++af(h,y))&&((u||g)&&h.push(y),s.push(v))}return g?(c(h.k),p(h)):u&&c(h),s}function ct(n){return function(t,e,r){var u={}; +if(e=v.createCallback(e,r,3),Ve(t)){r=-1;for(var o=t.length;++rk;k++)r+="n='"+e.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",e.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+e.g+"}"; +r+="}"}return(e.b||Je.nonEnumArgs)&&(r+="}"),r+=e.c+";return E",n("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",t+r+"}")(tt,W,he,Oe,d,dt,Ve,At,Q.f,ve,X,Ge,M,ye,_e)}function gt(n){return Xe[n]}function ht(){var t=(t=v.indexOf)===Gt?n:t;return t}function vt(n){return typeof n=="function"&&we.test(ke.call(n))}function yt(n){var t,e;return!n||_e.call(n)!=G||(t=n.constructor,Et(t)&&!(t instanceof t))||!Je.argsClass&&dt(n)||!Je.nodeClass&&l(n)?false:Je.ownLast?(er(n,function(n,t,r){return e=Oe.call(r,t),false}),false!==e):(er(n,function(n,t){e=t +}),typeof e=="undefined"||Oe.call(n,e))}function mt(n){return Ye[n]}function dt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&_e.call(n)==F||false}function bt(n,t,e){var r=arguments,u=0,o=typeof e=="number"?2:r.length;if(3e?Le(0,o+e):e)||0,Ve(n)?a=-1o&&(o=i)}}else t=null==t&&At(n)?r:v.createCallback(t,e,3),tr(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n) +});return o}function Lt(n,t,e,r){var u=3>arguments.length;if(t=v.createCallback(t,r,4),Ve(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++oarguments.length;return t=v.createCallback(t,r,4),Bt(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Wt(n){var t=-1,e=n?n.length:0,r=re(typeof e=="number"?e:0);return Tt(n,function(n){var e=ft(0,++t);r[t]=r[e],r[e]=n}),r}function qt(n,t,e){var r;if(t=v.createCallback(t,e,3),Ve(n)){e=-1; +for(var u=n.length;++er?Le(0,u+r):r||0}else if(r)return r=Mt(t,e),t[r]===e?r:-1;return n(t,e,r)}function Jt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0; +for(t=v.createCallback(t,e,3);++u>>1,e(n[r])e?0:e);++t=h;m?(u&&(u=xe(u)),c=a,o=n.apply(i,r)):u||(u=Ie(y,h))}return m&&f?f=xe(f):f||t===p||(f=Ie(v,t)),e&&(m=true,o=n.apply(i,r)),!m||f||u||(r=i=null),o}}function Yt(n){return n}function Zt(n,t,e){var r=true,u=t&&xt(t);t&&(e||u.length)||(null==e&&(e=t),o=y,t=n,n=v,u=xt(t)),false===e?r=false:Ot(e)&&"chain"in e&&(r=e.chain); +var o=n,a=Et(o);Tt(u,function(e){var u=n[e]=t[e];a&&(o.prototype[e]=function(){var t=this.__chain__,e=this.__wrapped__,a=[e];if(Se.apply(a,arguments),a=u.apply(n,a),r||t){if(e===a&&Ot(a))return this;a=new o(a),a.__chain__=t}return a})})}function ne(){}function te(n){return function(t){return t[n]}}function ee(){return this.__wrapped__}e=e?ut.defaults(Z.Object(),e,ut.pick(Z,T)):Z;var re=e.Array,ue=e.Boolean,oe=e.Date,ae=e.Function,ie=e.Math,fe=e.Number,le=e.Object,ce=e.RegExp,pe=e.String,se=e.TypeError,ge=[],he=e.Error.prototype,ve=le.prototype,ye=pe.prototype,me=e.window,de=me&&me.document,be=e._,_e=ve.toString,we=ce("^"+pe(_e).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),je=ie.ceil,xe=e.clearTimeout,Ce=ie.floor,ke=ae.prototype.toString,Ee=vt(Ee=le.getPrototypeOf)&&Ee,Oe=ve.hasOwnProperty,Se=ge.push,Ae=ve.propertyIsEnumerable,Ie=e.setTimeout,Ne=ge.splice,De=ge.unshift,Re=function(){try{var n={},t=vt(t=le.defineProperty)&&t,e=t(n,n,n)&&t +}catch(r){}return e}(),Pe=vt(Pe=le.create)&&Pe,Te=vt(Te=re.isArray)&&Te,Be=e.isFinite,Fe=e.isNaN,$e=vt($e=le.keys)&&$e,Le=ie.max,ze=ie.min,We=e.parseInt,qe=ie.random,Ke={};Ke[$]=re,Ke[L]=ue,Ke[z]=oe,Ke[q]=ae,Ke[G]=le,Ke[K]=fe,Ke[J]=ce,Ke[M]=pe;var Ge={};Ge[$]=Ge[z]=Ge[K]={constructor:true,toLocaleString:true,toString:true,valueOf:true},Ge[L]=Ge[M]={constructor:true,toString:true,valueOf:true},Ge[W]=Ge[q]=Ge[J]={constructor:true,toString:true},Ge[G]={constructor:true},function(){for(var n=B.length;n--;){var t,e=B[n]; +for(t in Ge)Oe.call(Ge,t)&&!Oe.call(Ge[t],e)&&(Ge[t][e]=false)}}(),y.prototype=v.prototype;var Je=v.support={};!function(){var n=function(){this.x=1},t={0:1,length:1},r=[];n.prototype={valueOf:1,y:1};for(var u in new n)r.push(u);for(u in arguments);Je.argsClass=_e.call(arguments)==F,Je.argsObject=arguments.constructor==le&&!(arguments instanceof re),Je.dom=!!de&&typeof de=="object"&&we.test(xe)&&we.test(Ie),Je.enumErrorProps=Ae.call(he,"message")||Ae.call(he,"name"),Je.enumPrototypes=Ae.call(n,"prototype"),Je.funcDecomp=!vt(e.WinRTError)&&R.test(g),Je.funcNames=typeof ae.name=="string",Je.nonEnumArgs=0!=u,Je.nonEnumShadows=!/valueOf/.test(r),Je.ownLast="x"!=r[0],Je.spliceObjects=(ge.splice.call(t,0,1),!t[0]),Je.unindexedChars="xx"!="x"[0]+le("x")[0]; +try{Je.nodeClass=!(_e.call(de)==G&&!({toString:0}+""))}catch(o){Je.nodeClass=true}}(1),v.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:I,variable:"",imports:{_:v}},Pe||(nt=function(){function n(){}return function(t){if(Ot(t)){n.prototype=t;var r=new n;n.prototype=null}return r||e.Object()}}());var Me=Re?function(n,t){H.value=t,Re(n,"__bindData__",H)}:ne;Je.argsClass||(dt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Oe.call(n,"callee")&&!Ae.call(n,"callee")||false});var Ve=Te||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&_e.call(n)==$||false +},Ue=st({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),He=$e?function(n){return Ot(n)?Je.enumPrototypes&&typeof n=="function"||Je.nonEnumArgs&&n.length&&dt(n)?Ue(n):$e(n):[]}:Ue,Qe={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:He,g:"if(e(t[n],n,g)===false)return E"},Xe={"&":"&","<":"<",">":">",'"':""","'":"'"},Ye=Ct(Xe),Ze=ce("("+He(Ye).join("|")+")","g"),nr=ce("["+He(Xe).join("")+"]","g"),tr=st(Qe),er=st(Qe,{i:"if(!B[typeof t])return E;"+Qe.i,b:false,j:false}); +Je.dom||(kt=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!rr(n)||false}),Et(/x/)&&(Et=function(n){return typeof n=="function"&&_e.call(n)==q});var rr=Ee?function(n){if(!n||_e.call(n)!=G||!Je.argsClass&&dt(n))return false;var t=n.valueOf,e=vt(t)&&(e=Ee(t))&&Ee(e);return e?n==e||Ee(n)==e:yt(n)}:yt,ur=ct(function(n,t,e){Oe.call(n,e)?n[e]++:n[e]=1}),or=ct(function(n,t,e){(Oe.call(n,e)?n[e]:n[e]=[]).push(t)}),ar=ct(function(n,t,e){n[e]=t}),ir=Ft,fr=vt(fr=oe.now)&&fr||function(){return(new oe).getTime() +},lr=8==We(j+"08")?We:function(n,t){return We(At(n)?n.replace(N,""):n,t||0)};return v.after=function(n,t){if(!Et(t))throw new se;return function(){return 1>--n?t.apply(this,arguments):void 0}},v.assign=bt,v.at=function(n){var t=arguments,e=-1,r=ot(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=re(t);for(Je.unindexedChars&&At(n)&&(n=n.split(""));++e=_&&o(r?e[r]:s))) +}var l=e[0],h=-1,v=l?l.length:0,y=[];n:for(;++h(m?t(m,g):f(s,g))){for(r=u,(m||s).push(g);--r;)if(m=a[r],0>(m?t(m,g):f(e[r],g)))continue n;y.push(g)}}for(;u--;)(m=a[u])&&p(m);return c(a),c(s),y},v.invert=Ct,v.invoke=function(n,t){var e=s(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=re(typeof o=="number"?o:0);return Tt(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},v.keys=He,v.map=Ft,v.mapValues=function(n,t,e){var r={};return t=v.createCallback(t,e,3),wt(n,function(n,e,u){r[e]=t(n,e,u) +}),r},v.max=$t,v.memoize=function(n,t){if(!Et(n))throw new se;var e=function(){var r=e.cache,u=t?t.apply(this,arguments):b+arguments[0];return Oe.call(r,u)?r[u]:r[u]=n.apply(this,arguments)};return e.cache={},e},v.merge=function(n){var t=arguments,e=2;if(!Ot(n))return n;if("number"!=typeof t[2]&&(e=t.length),3e?Le(0,r+e):ze(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},v.mixin=Zt,v.noConflict=function(){return e._=be,this},v.noop=ne,v.now=fr,v.parseInt=lr,v.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=qe(),ze(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):ft(n,t) +},v.reduce=Lt,v.reduceRight=zt,v.result=function(n,t){if(n){var e=n[t];return Et(e)?n[t]():e}},v.runInContext=g,v.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:He(n).length},v.some=qt,v.sortedIndex=Mt,v.template=function(n,t,e){var r=v.templateSettings;n=pe(n||""),e=_t({},e,r);var u,o=_t({},e.imports,r.imports),r=He(o),o=It(o),i=0,f=e.interpolate||D,l="__p+='",f=ce((e.escape||D).source+"|"+f.source+"|"+(f===I?O:D).source+"|"+(e.evaluate||D).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(i,c).replace(P,a),e&&(l+="'+__e("+e+")+'"),f&&(u=true,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t +}),l+="';",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(x,""):l).replace(C,"$1").replace(E,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=ae(r,"return "+l).apply(h,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},v.unescape=function(n){return null==n?"":(n=pe(n),0>n.indexOf(";")?n:n.replace(Ze,mt))},v.uniqueId=function(n){var t=++m; +return pe(null==n?"":n)+t},v.all=Dt,v.any=qt,v.detect=Pt,v.findWhere=Pt,v.foldl=Lt,v.foldr=zt,v.include=Nt,v.inject=Lt,Zt(function(){var n={};return wt(v,function(t,e){v.prototype[e]||(n[e]=t)}),n}(),false),v.first=Kt,v.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,Le(0,u-r))},v.sample=function(n,t,e){return n&&typeof n.length!="number"?n=It(n):Je.unindexedChars&&At(n)&&(n=n.split("")),null==t||e?n?n[ft(0,n.length-1)]:h:(n=Wt(n),n.length=ze(Le(0,t),n.length),n) +},v.take=Kt,v.head=Kt,wt(v,function(n,t){var e="sample"!==t;v.prototype[t]||(v.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new y(o,u):o})}),v.VERSION="2.4.1",v.prototype.chain=function(){return this.__chain__=true,this},v.prototype.toString=function(){return pe(this.__wrapped__)},v.prototype.value=ee,v.prototype.valueOf=ee,tr(["join","pop","shift"],function(n){var t=ge[n];v.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments); +return n?new y(e,n):e}}),tr(["push","reverse","sort","unshift"],function(n){var t=ge[n];v.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),tr(["concat","slice","splice"],function(n){var t=ge[n];v.prototype[n]=function(){return new y(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Je.spliceObjects||tr(["pop","shift","splice"],function(n){var t=ge[n],e="splice"==n;v.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,u=t.apply(r,arguments);return 0===r.length&&delete r[0],n||e?new y(u,n):u +}}),v}var h,v=[],y=[],m=0,d={},b=+new Date+"",_=75,w=40,j=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",x=/\b__p\+='';/g,C=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,O=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,S=/\w*$/,A=/^\s*function[ \n\r\t]+\w/,I=/<%=([\s\S]+?)%>/g,N=RegExp("^["+j+"]*0+(?=.$)"),D=/($^)/,R=/\bthis\b/,P=/['\n\r\t\u2028\u2029\\]/g,T="Array Boolean Date Error Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),B="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),F="[object Arguments]",$="[object Array]",L="[object Boolean]",z="[object Date]",W="[object Error]",q="[object Function]",K="[object Number]",G="[object Object]",J="[object RegExp]",M="[object String]",V={}; +V[q]=false,V[F]=V[$]=V[L]=V[z]=V[K]=V[G]=V[J]=V[M]=true;var U={leading:false,maxWait:0,trailing:false},H={configurable:false,enumerable:false,value:null,writable:false},Q={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:false},X={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Z=X[typeof window]&&window||this,nt=X[typeof exports]&&exports&&!exports.nodeType&&exports,tt=X[typeof module]&&module&&!module.nodeType&&module,et=tt&&tt.exports===nt&&nt,rt=X[typeof global]&&global; !rt||rt.global!==rt&&rt.window!==rt||(Z=rt);var ut=g();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Z._=ut, define(function(){return ut})):nt&&tt?et?(tt.exports=ut)._=ut:nt._=ut:Z._=ut}).call(this); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index 32a243c47..f2fcd170c 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -1688,32 +1688,31 @@ * defaults(object, { 'name': 'fred', 'employer': 'slate' }); * // => { 'name': 'barney', 'employer': 'slate' } */ - var assign = function(object, source, guard) { - var index, iterable = object, result = iterable; - if (!iterable) return result; + function assign(object, source, guard) { var args = arguments, argsIndex = 0, argsLength = typeof guard == 'number' ? 2 : args.length; + if (argsLength > 3 && typeof args[argsLength - 2] == 'function') { var callback = baseCreateCallback(args[--argsLength - 1], args[argsLength--], 2); } else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') { callback = args[--argsLength]; } while (++argsIndex < argsLength) { - iterable = args[argsIndex]; - if (iterable && objectTypes[typeof iterable]) { - var ownIndex = -1, - ownProps = objectTypes[typeof iterable] && keys(iterable), - length = ownProps ? ownProps.length : 0; + source = args[argsIndex]; + if (isObject(source)) { + var index = -1, + props = keys(source), + length = props.length; - while (++ownIndex < length) { - index = ownProps[ownIndex]; - result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]; - } + while (++index < length) { + var key = props[index]; + object[key] = callback ? callback(object[key], source[key]) : source[key]; + } } } - return result - }; + return object; + } /** * Creates a clone of `value`. If `isDeep` is `true` nested objects will also @@ -1867,27 +1866,28 @@ * _.defaults(object, { 'name': 'fred', 'employer': 'slate' }); * // => { 'name': 'barney', 'employer': 'slate' } */ - var defaults = function(object, source, guard) { - var index, iterable = object, result = iterable; - if (!iterable) return result; + function defaults(object, source, guard) { var args = arguments, argsIndex = 0, argsLength = typeof guard == 'number' ? 2 : args.length; - while (++argsIndex < argsLength) { - iterable = args[argsIndex]; - if (iterable && objectTypes[typeof iterable]) { - var ownIndex = -1, - ownProps = objectTypes[typeof iterable] && keys(iterable), - length = ownProps ? ownProps.length : 0; - while (++ownIndex < length) { - index = ownProps[ownIndex]; - if (typeof result[index] == 'undefined') result[index] = iterable[index]; - } + while (++argsIndex < argsLength) { + source = args[argsIndex]; + if (isObject(source)) { + var index = -1, + props = keys(source), + length = props.length; + + while (++index < length) { + var key = props[index]; + if (typeof object[key] == 'undefined') { + object[key] = source[key]; + } + } } } - return result - }; + return object; + } /** * This method is like `_.findIndex` except that it returns the key of the @@ -2103,21 +2103,20 @@ * }); * // => logs '0', '1', and 'length' (property order is not guaranteed across environments) */ - var forOwn = function(collection, callback, thisArg) { - var index, iterable = collection, result = iterable; - if (!iterable) return result; - if (!objectTypes[typeof iterable]) return result; - callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); - var ownIndex = -1, - ownProps = objectTypes[typeof iterable] && keys(iterable), - length = ownProps ? ownProps.length : 0; + function forOwn(object, callback, thisArg) { + var index = -1, + props = keys(object), + length = props.length; - while (++ownIndex < length) { - index = ownProps[ownIndex]; - if (callback(iterable[index], index, collection) === false) return result; + callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); + while (++index < length) { + var key = props[index]; + if (callback(object[key], key, object) === false) { + break; } - return result - }; + } + return object; + } /** * This method is like `_.forOwn` except that it iterates over elements diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 5a1b10b2c..4da3c2a6b 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -5,52 +5,51 @@ */ ;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++ea||typeof i=="undefined")return 1;if(ie?0:e);++r=b&&i===n,l=[];if(f){var p=o(r);p?(i=t,r=p):f=false}for(;++ui(r,p)&&l.push(p);return f&&c(r),l}function ut(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r=b&&f===n,h=u||v?a():s; -for(v&&(h=o(h),f=t);++if(h,y))&&((u||v)&&h.push(y),s.push(g))}return v?(l(h.k),c(h)):u&&l(h),s}function lt(n){return function(t,e,r){var u={};e=J.createCallback(e,r,3),r=-1;var o=t?t.length:0;if(typeof o=="number")for(;++re?Re(0,o+e):e)||0,We(n)?i=-1o&&(o=a)}}else t=null==t&&xt(n)?r:J.createCallback(t,e,3),It(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Dt(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=J.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++oarguments.length;return t=J.createCallback(t,r,4),Rt(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Ft(n){var t=-1,e=n?n.length:0,r=Yt(typeof e=="number"?e:0);return It(n,function(n){var e=at(0,++t);r[t]=r[e],r[e]=n}),r}function Bt(n,t,e){var r;t=J.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++er?Re(0,u+r):r||0}else if(r)return r=Pt(t,e),t[r]===e?r:-1;return n(t,e,r)}function zt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=J.createCallback(t,e,3);++u>>1,e(n[r])e?0:e);++t=v; -m?(i&&(i=ye(i)),s=f,a=n.apply(l,o)):i||(i=je(r,v))}return m&&c?c=ye(c):c||t===h||(c=je(u,t)),e&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a}}function Gt(n){return n}function Ht(n,t,e){var r=true,u=t&&bt(t);t&&(e||u.length)||(null==e&&(e=t),o=Q,t=n,n=J,u=bt(t)),false===e?r=false:jt(e)&&"chain"in e&&(r=e.chain);var o=n,i=wt(o);It(u,function(e){var u=n[e]=t[e];i&&(o.prototype[e]=function(){var t=this.__chain__,e=this.__wrapped__,i=[e];if(we.apply(i,arguments),i=u.apply(n,i),r||t){if(e===i&&jt(i))return this; -i=new o(i),i.__chain__=t}return i})})}function Jt(){}function Qt(n){return function(t){return t[n]}}function Xt(){return this.__wrapped__}e=e?Y.defaults(G.Object(),e,Y.pick(G,T)):G;var Yt=e.Array,Zt=e.Boolean,ne=e.Date,te=e.Function,ee=e.Math,re=e.Number,ue=e.Object,oe=e.RegExp,ie=e.String,ae=e.TypeError,fe=[],le=ue.prototype,ce=e.window,pe=ce&&ce.document,se=e._,ve=le.toString,he=oe("^"+ie(ve).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),ge=ee.ceil,ye=e.clearTimeout,me=ee.floor,be=te.prototype.toString,de=vt(de=ue.getPrototypeOf)&&de,_e=le.hasOwnProperty,we=fe.push,je=e.setTimeout,ke=fe.splice,xe=fe.unshift,Ce=function(){try{var n={},t=vt(t=ue.defineProperty)&&t,e=t(n,n,n)&&t -}catch(r){}return e}(),Oe=vt(Oe=ue.create)&&Oe,Ee=vt(Ee=Yt.isArray)&&Ee,Ne=e.isFinite,Se=e.isNaN,Ie=vt(Ie=ue.keys)&&Ie,Re=ee.max,Te=ee.min,Ae=e.parseInt,De=ee.random,$e={};$e[D]=Yt,$e[$]=Zt,$e[F]=ne,$e[B]=te,$e[q]=ue,$e[W]=re,$e[z]=oe,$e[P]=ie,Q.prototype=J.prototype;var Fe=J.support={};Fe.dom=!!pe&&typeof pe=="object"&&he.test(ye)&&he.test(je),Fe.funcDecomp=!vt(e.WinRTError)&&I.test(s),Fe.funcNames=typeof te.name=="string",J.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:E,variable:"",imports:{_:J}},Oe||(nt=function(){function n(){}return function(t){if(jt(t)){n.prototype=t; -var r=new n;n.prototype=null}return r||e.Object()}}());var Be=Ce?function(n,t){M.value=t,Ce(n,"__bindData__",M)}:Jt,We=Ee||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n)==D||false},qe=Ie?function(n){return jt(n)?Ie(n):[]}:H,ze={"&":"&","<":"<",">":">",'"':""","'":"'"},Pe=dt(ze),Ke=oe("("+qe(Pe).join("|")+")","g"),Le=oe("["+qe(ze).join("")+"]","g");Fe.dom||(_t=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!Me(n)||false});var Me=de?function(n){if(!n||ve.call(n)!=q)return false; -var t=n.valueOf,e=vt(t)&&(e=de(t))&&de(e);return e?n==e||de(n)==e:ht(n)}:ht,Ve=lt(function(n,t,e){_e.call(n,e)?n[e]++:n[e]=1}),Ue=lt(function(n,t,e){(_e.call(n,e)?n[e]:n[e]=[]).push(t)}),Ge=lt(function(n,t,e){n[e]=t}),He=Tt,Je=vt(Je=ne.now)&&Je||function(){return(new ne).getTime()},Qe=8==Ae(_+"08")?Ae:function(n,t){return Ae(xt(n)?n.replace(N,""):n,t||0)};return J.after=function(n,t){if(!wt(t))throw new ae;return function(){return 1>--n?t.apply(this,arguments):void 0}},J.assign=U,J.at=function(n){for(var t=arguments,e=-1,r=ut(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Yt(t);++e=b&&o(r?e[r]:s)))}var p=e[0],h=-1,g=p?p.length:0,y=[];n:for(;++h(m?t(m,v):f(s,v))){for(r=u,(m||s).push(v);--r;)if(m=i[r],0>(m?t(m,v):f(e[r],v)))continue n;y.push(v)}}for(;u--;)(m=i[u])&&c(m);return l(i),l(s),y},J.invert=dt,J.invoke=function(n,t){var e=p(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,i=Yt(typeof o=="number"?o:0);return It(n,function(n){i[++r]=(u?t:n[t]).apply(n,e)}),i},J.keys=qe,J.map=Tt,J.mapValues=function(n,t,e){var r={}; -return t=J.createCallback(t,e,3),h(n,function(n,e,u){r[e]=t(n,e,u)}),r},J.max=At,J.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):m+arguments[0];return _e.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!wt(n))throw new ae;return e.cache={},e},J.merge=function(n){var t=arguments,e=2;if(!jt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3e?Re(0,r+e):Te(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},J.mixin=Ht,J.noConflict=function(){return e._=se,this},J.noop=Jt,J.now=Je,J.parseInt=Qe,J.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=De(),Te(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):at(n,t) -},J.reduce=Dt,J.reduceRight=$t,J.result=function(n,t){if(n){var e=n[t];return wt(e)?n[t]():e}},J.runInContext=s,J.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:qe(n).length},J.some=Bt,J.sortedIndex=Pt,J.template=function(n,t,e){var r=J.templateSettings;n=ie(n||""),e=d({},e,r);var u,o=d({},e.imports,r.imports),r=qe(o),o=Ct(o),a=0,f=e.interpolate||S,l="__p+='",f=oe((e.escape||S).source+"|"+f.source+"|"+(f===E?x:S).source+"|"+(e.evaluate||S).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(a,c).replace(R,i),e&&(l+="'+__e("+e+")+'"),f&&(u=true,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),a=c+t.length,t -}),l+="';",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(w,""):l).replace(j,"$1").replace(k,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=te(r,"return "+l).apply(v,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},J.unescape=function(n){return null==n?"":(n=ie(n),0>n.indexOf(";")?n:n.replace(Ke,gt))},J.uniqueId=function(n){var t=++y; -return ie(null==n?"":n)+t},J.all=Et,J.any=Bt,J.detect=St,J.findWhere=St,J.foldl=Dt,J.foldr=$t,J.include=Ot,J.inject=Dt,Ht(function(){var n={};return h(J,function(t,e){J.prototype[e]||(n[e]=t)}),n}(),false),J.first=Wt,J.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=J.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:v;return p(n,Re(0,u-r))},J.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=Ct(n)),null==t||e?n?n[at(0,n.length-1)]:v:(n=Ft(n),n.length=Te(Re(0,t),n.length),n) -},J.take=Wt,J.head=Wt,h(J,function(n,t){var e="sample"!==t;J.prototype[t]||(J.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new Q(o,u):o})}),J.VERSION="2.4.1",J.prototype.chain=function(){return this.__chain__=true,this},J.prototype.toString=function(){return ie(this.__wrapped__)},J.prototype.value=Xt,J.prototype.valueOf=Xt,It(["join","pop","shift"],function(n){var t=fe[n];J.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments); -return n?new Q(e,n):e}}),It(["push","reverse","sort","unshift"],function(n){var t=fe[n];J.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),It(["concat","slice","splice"],function(n){var t=fe[n];J.prototype[n]=function(){return new Q(t.apply(this.__wrapped__,arguments),this.__chain__)}}),J}var v,h=[],g=[],y=0,m=+new Date+"",b=75,d=40,_=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",w=/\b__p\+='';/g,j=/\b(__p\+=)''\+/g,k=/(__e\(.*?\)|\b__t\))\+'';/g,x=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,C=/\w*$/,O=/^\s*function[ \n\r\t]+\w/,E=/<%=([\s\S]+?)%>/g,N=RegExp("^["+_+"]*0+(?=.$)"),S=/($^)/,I=/\bthis\b/,R=/['\n\r\t\u2028\u2029\\]/g,T="Array Boolean Date Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),A="[object Arguments]",D="[object Array]",$="[object Boolean]",F="[object Date]",B="[object Function]",W="[object Number]",q="[object Object]",z="[object RegExp]",P="[object String]",K={}; -K[B]=false,K[A]=K[D]=K[$]=K[F]=K[W]=K[q]=K[z]=K[P]=true;var L={leading:false,maxWait:0,trailing:false},M={configurable:false,enumerable:false,value:null,writable:false},V={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},U={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},G=V[typeof window]&&!({toString:0}+"")||this,H=V[typeof exports]&&exports&&!exports.nodeType&&exports,J=V[typeof module]&&module&&!module.nodeType&&module,Q=J&&J.exports===H&&H,X=V[typeof global]&&global; -!X||X.global!==X&&X.window!==X||(G=X);var Y=s();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(G._=Y, define(function(){return Y})):H&&J?Q?(J.exports=Y)._=Y:H._=Y:G._=Y}).call(this); \ No newline at end of file +}function a(){return h.pop()||[]}function f(){return g.pop()||{k:null,l:null,m:null,"false":false,n:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,o:null}}function l(n){n.length=0,h.lengthe?0:e);++r=b&&i===n,l=[]; +if(f){var p=o(r);p?(i=t,r=p):f=false}for(;++ui(r,p)&&l.push(p);return f&&c(r),l}function tt(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r=b&&f===n,h=u||v?a():s;for(v&&(h=o(h),f=t);++if(h,y))&&((u||v)&&h.push(y),s.push(g)) +}return v?(l(h.k),c(h)):u&&l(h),s}function it(n){return function(t,e,r){var u={};e=d.createCallback(e,r,3),r=-1;var o=t?t.length:0;if(typeof o=="number")for(;++re?Se(0,o+e):e)||0,We(n)?i=-1o&&(o=a)}}else t=null==t&&xt(n)?r:d.createCallback(t,e,3),Rt(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Dt(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=d.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++oarguments.length;return t=d.createCallback(t,r,4),St(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o) +}),e}function Ft(n){var t=-1,e=n?n.length:0,r=Yt(typeof e=="number"?e:0);return Rt(n,function(n){var e=ut(0,++t);r[t]=r[e],r[e]=n}),r}function Bt(n,t,e){var r;t=d.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++er?Se(0,u+r):r||0}else if(r)return r=Pt(t,e),t[r]===e?r:-1;return n(t,e,r)}function zt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=d.createCallback(t,e,3);++u>>1,e(n[r])e?0:e);++t=v;m?(i&&(i=ye(i)),s=f,a=n.apply(l,o)):i||(i=je(r,v))}return m&&c?c=ye(c):c||t===h||(c=je(u,t)),e&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a}}function Gt(n){return n}function Ht(n,t,e){var r=true,u=t&&bt(t); +t&&(e||u.length)||(null==e&&(e=t),o=U,t=n,n=d,u=bt(t)),false===e?r=false:jt(e)&&"chain"in e&&(r=e.chain);var o=n,i=wt(o);Rt(u,function(e){var u=n[e]=t[e];i&&(o.prototype[e]=function(){var t=this.__chain__,e=this.__wrapped__,i=[e];if(we.apply(i,arguments),i=u.apply(n,i),r||t){if(e===i&&jt(i))return this;i=new o(i),i.__chain__=t}return i})})}function Jt(){}function Qt(n){return function(t){return t[n]}}function Xt(){return this.__wrapped__}e=e?Y.defaults(G.Object(),e,Y.pick(G,T)):G;var Yt=e.Array,Zt=e.Boolean,ne=e.Date,te=e.Function,ee=e.Math,re=e.Number,ue=e.Object,oe=e.RegExp,ie=e.String,ae=e.TypeError,fe=[],le=ue.prototype,ce=e.window,pe=ce&&ce.document,se=e._,ve=le.toString,he=oe("^"+ie(ve).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),ge=ee.ceil,ye=e.clearTimeout,me=ee.floor,be=te.prototype.toString,de=ct(de=ue.getPrototypeOf)&&de,_e=le.hasOwnProperty,we=fe.push,je=e.setTimeout,ke=fe.splice,xe=fe.unshift,Ce=function(){try{var n={},t=ct(t=ue.defineProperty)&&t,e=t(n,n,n)&&t +}catch(r){}return e}(),Oe=ct(Oe=ue.create)&&Oe,Ee=ct(Ee=Yt.isArray)&&Ee,Ne=e.isFinite,Ie=e.isNaN,Re=ct(Re=ue.keys)&&Re,Se=ee.max,Te=ee.min,Ae=e.parseInt,De=ee.random,$e={};$e[D]=Yt,$e[$]=Zt,$e[F]=ne,$e[B]=te,$e[q]=ue,$e[W]=re,$e[z]=oe,$e[P]=ie,U.prototype=d.prototype;var Fe=d.support={};Fe.dom=!!pe&&typeof pe=="object"&&he.test(ye)&&he.test(je),Fe.funcDecomp=!ct(e.WinRTError)&&R.test(s),Fe.funcNames=typeof te.name=="string",d.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:E,variable:"",imports:{_:d}},Oe||(Q=function(){function n(){}return function(t){if(jt(t)){n.prototype=t; +var r=new n;n.prototype=null}return r||e.Object()}}());var Be=Ce?function(n,t){M.value=t,Ce(n,"__bindData__",M)}:Jt,We=Ee||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n)==D||false},qe=Re?function(n){return jt(n)?Re(n):[]}:g,ze={"&":"&","<":"<",">":">",'"':""","'":"'"},Pe=dt(ze),Ke=oe("("+qe(Pe).join("|")+")","g"),Le=oe("["+qe(ze).join("")+"]","g");Fe.dom||(_t=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!Me(n)||false});var Me=de?function(n){if(!n||ve.call(n)!=q)return false; +var t=n.valueOf,e=ct(t)&&(e=de(t))&&de(e);return e?n==e||de(n)==e:pt(n)}:pt,Ve=it(function(n,t,e){_e.call(n,e)?n[e]++:n[e]=1}),Ue=it(function(n,t,e){(_e.call(n,e)?n[e]:n[e]=[]).push(t)}),Ge=it(function(n,t,e){n[e]=t}),He=Tt,Je=ct(Je=ne.now)&&Je||function(){return(new ne).getTime()},Qe=8==Ae(_+"08")?Ae:function(n,t){return Ae(xt(n)?n.replace(N,""):n,t||0)};return d.after=function(n,t){if(!wt(t))throw new ae;return function(){return 1>--n?t.apply(this,arguments):void 0}},d.assign=ht,d.at=function(n){for(var t=arguments,e=-1,r=tt(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Yt(t);++e=b&&o(r?e[r]:s)))}var p=e[0],h=-1,g=p?p.length:0,y=[];n:for(;++h(m?t(m,v):f(s,v))){for(r=u,(m||s).push(v);--r;)if(m=i[r],0>(m?t(m,v):f(e[r],v)))continue n;y.push(v)}}for(;u--;)(m=i[u])&&c(m);return l(i),l(s),y},d.invert=dt,d.invoke=function(n,t){var e=p(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,i=Yt(typeof o=="number"?o:0);return Rt(n,function(n){i[++r]=(u?t:n[t]).apply(n,e)}),i},d.keys=qe,d.map=Tt,d.mapValues=function(n,t,e){var r={}; +return t=d.createCallback(t,e,3),yt(n,function(n,e,u){r[e]=t(n,e,u)}),r},d.max=At,d.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):m+arguments[0];return _e.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!wt(n))throw new ae;return e.cache={},e},d.merge=function(n){var t=arguments,e=2;if(!jt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3e?Se(0,r+e):Te(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},d.mixin=Ht,d.noConflict=function(){return e._=se,this},d.noop=Jt,d.now=Je,d.parseInt=Qe,d.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=De(),Te(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):ut(n,t) +},d.reduce=Dt,d.reduceRight=$t,d.result=function(n,t){if(n){var e=n[t];return wt(e)?n[t]():e}},d.runInContext=s,d.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:qe(n).length},d.some=Bt,d.sortedIndex=Pt,d.template=function(n,t,e){var r=d.templateSettings;n=ie(n||""),e=gt({},e,r);var u,o=gt({},e.imports,r.imports),r=qe(o),o=Ct(o),a=0,f=e.interpolate||I,l="__p+='",f=oe((e.escape||I).source+"|"+f.source+"|"+(f===E?x:I).source+"|"+(e.evaluate||I).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(a,c).replace(S,i),e&&(l+="'+__e("+e+")+'"),f&&(u=true,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),a=c+t.length,t +}),l+="';",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(w,""):l).replace(j,"$1").replace(k,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=te(r,"return "+l).apply(v,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},d.unescape=function(n){return null==n?"":(n=ie(n),0>n.indexOf(";")?n:n.replace(Ke,st))},d.uniqueId=function(n){var t=++y; +return ie(null==n?"":n)+t},d.all=Et,d.any=Bt,d.detect=It,d.findWhere=It,d.foldl=Dt,d.foldr=$t,d.include=Ot,d.inject=Dt,Ht(function(){var n={};return yt(d,function(t,e){d.prototype[e]||(n[e]=t)}),n}(),false),d.first=Wt,d.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=d.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:v;return p(n,Se(0,u-r))},d.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=Ct(n)),null==t||e?n?n[ut(0,n.length-1)]:v:(n=Ft(n),n.length=Te(Se(0,t),n.length),n) +},d.take=Wt,d.head=Wt,yt(d,function(n,t){var e="sample"!==t;d.prototype[t]||(d.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new U(o,u):o})}),d.VERSION="2.4.1",d.prototype.chain=function(){return this.__chain__=true,this},d.prototype.toString=function(){return ie(this.__wrapped__)},d.prototype.value=Xt,d.prototype.valueOf=Xt,Rt(["join","pop","shift"],function(n){var t=fe[n];d.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments); +return n?new U(e,n):e}}),Rt(["push","reverse","sort","unshift"],function(n){var t=fe[n];d.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Rt(["concat","slice","splice"],function(n){var t=fe[n];d.prototype[n]=function(){return new U(t.apply(this.__wrapped__,arguments),this.__chain__)}}),d}var v,h=[],g=[],y=0,m=+new Date+"",b=75,d=40,_=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",w=/\b__p\+='';/g,j=/\b(__p\+=)''\+/g,k=/(__e\(.*?\)|\b__t\))\+'';/g,x=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,C=/\w*$/,O=/^\s*function[ \n\r\t]+\w/,E=/<%=([\s\S]+?)%>/g,N=RegExp("^["+_+"]*0+(?=.$)"),I=/($^)/,R=/\bthis\b/,S=/['\n\r\t\u2028\u2029\\]/g,T="Array Boolean Date Function Math Number Object RegExp String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),A="[object Arguments]",D="[object Array]",$="[object Boolean]",F="[object Date]",B="[object Function]",W="[object Number]",q="[object Object]",z="[object RegExp]",P="[object String]",K={}; +K[B]=false,K[A]=K[D]=K[$]=K[F]=K[W]=K[q]=K[z]=K[P]=true;var L={leading:false,maxWait:0,trailing:false},M={configurable:false,enumerable:false,value:null,writable:false},V={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},U={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},G=V[typeof window]&&window||this,H=V[typeof exports]&&exports&&!exports.nodeType&&exports,J=V[typeof module]&&module&&!module.nodeType&&module,Q=J&&J.exports===H&&H,X=V[typeof global]&&global;!X||X.global!==X&&X.window!==X||(G=X); +var Y=s();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(G._=Y, define(function(){return Y})):H&&J?Q?(J.exports=Y)._=Y:H._=Y:G._=Y}).call(this); \ No newline at end of file diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index dc0860b1f..e452ad5fd 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -1195,17 +1195,19 @@ * }); * // => logs '0', '1', and 'length' (property order is not guaranteed across environments) */ - var forOwn = function(collection, callback) { - var index, iterable = collection, result = iterable; - if (!iterable) return result; - if (!objectTypes[typeof iterable]) return result; - for (index in iterable) { - if (hasOwnProperty.call(iterable, index)) { - if (callback(iterable[index], index, collection) === indicatorObject) return result; - } + function forOwn(object, callback) { + var index = -1, + props = keys(object), + length = props.length; + + while (++index < length) { + var key = props[index]; + if (callback(object[key], key, object) === indicatorObject) { + break; } - return result - }; + } + return object; + } /** * Creates a sorted array of property names of all enumerable properties, diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index fd4b50e0b..f70a8911e 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -3,37 +3,37 @@ * Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE * Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js` */ -;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++tf||typeof i=="undefined")return 1;if(it?0:t);++ee(r,i)&&o.push(i)}return o}function p(n,r,t,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++eu(f,l))&&(t&&f.push(l),i.push(a))}return i}function h(n){return function(r,t,e){var u={};t=X(t,e,3),e=-1;var o=r?r.length:0;if(typeof o=="number")for(;++eu&&(u=t);else r=X(r,t,3),D(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function W(n,r,t,e){if(!n)return t;var u=3>arguments.length;r=X(r,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(t=n[++o]);++oarguments.length;return r=X(r,e,4),I(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o) -}),t}function C(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return D(n,function(n){var t;t=++r,t=0+Sr(zr()*(t-0+1)),e[r]=e[t],e[t]=n}),e}function P(n,r,t){var e;r=X(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++te?$r(0,u+e):e||0}else if(e)return e=J(r,t),r[e]===t?e:-1;return n(r,t,e)}function H(n,r,t){if(typeof r!="number"&&null!=r){var u=0,o=-1,i=n?n.length:0;for(r=X(r,t,3);++o>>1,t(n[e])=y;m?(u&&(u=clearTimeout(u)),c=i,o=n.apply(f,e)):u||(u=setTimeout(v,y))}return m&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(h,r)),t&&(m=true,o=n.apply(f,e)),!m||a||u||(e=f=null),o}}function X(n,r,t){var e=typeof n;if(null==n||"function"==e)return a(n,r,t);if("object"!=e)return nr(n);var u=Vr(n);return function(r){for(var t=u.length,e=false;t--&&(e=r[u[t]]===n[u[t]]););return e}}function Y(n){return n -}function Z(n){D(x(n),function(r){var t=u[r]=n[r];u.prototype[r]=function(){var n=[this.__wrapped__];return Fr.apply(n,arguments),n=t.apply(u,n),this.__chain__?new o(n,true):n}})}function nr(n){return function(r){return r[n]}}var rr,tr=0,er={},ur=+new Date+"",or=/($^)/,ir=/['\n\r\t\u2028\u2029\\]/g,fr="[object Arguments]",ar="[object Array]",lr="[object Boolean]",cr="[object Date]",pr="[object Number]",sr="[object Object]",gr="[object RegExp]",hr="[object String]",vr={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},yr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},mr=vr[typeof window]&&window||this,_r=vr[typeof exports]&&exports&&!exports.nodeType&&exports,dr=vr[typeof module]&&module&&!module.nodeType&&module,br=dr&&dr.exports===_r&&_r,wr=vr[typeof global]&&global; -!wr||wr.global!==wr&&wr.window!==wr||(mr=wr);var jr=[],xr=Object.prototype,Tr=mr._,Er=xr.toString,Ar=RegExp("^"+(Er+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Or=Math.ceil,Sr=Math.floor,Nr=Function.prototype.toString,Rr=xr.hasOwnProperty,Fr=jr.push,kr=xr.propertyIsEnumerable,Br=_(Br=Object.create)&&Br,qr=_(qr=Array.isArray)&&qr,Dr=mr.isFinite,Ir=mr.isNaN,Mr=_(Mr=Object.keys)&&Mr,$r=Math.max,Wr=Math.min,zr=Math.random;o.prototype=u.prototype;var Cr={};!function(){var n={0:1,length:1}; -Cr.spliceObjects=(jr.splice.call(n,0,1),!n[0])}(1),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Br||(f=function(){function n(){}return function(r){if(O(r)){n.prototype=r;var t=new n;n.prototype=null}return t||mr.Object()}}()),b(arguments)||(b=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Rr.call(n,"callee")&&!kr.call(n,"callee")||false});var Pr=qr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Er.call(n)==ar||false -},Ur=function(n){var r,t=[];if(!n||!vr[typeof n])return t;for(r in n)Rr.call(n,r)&&t.push(r);return t},Vr=Mr?function(n){return O(n)?Mr(n):[]}:Ur,Gr={"&":"&","<":"<",">":">",'"':""","'":"'"},Hr=T(Gr),Jr=RegExp("("+Vr(Hr).join("|")+")","g"),Kr=RegExp("["+Vr(Gr).join("")+"]","g"),Lr=function(n,r){var t;if(!n||!vr[typeof n])return n;for(t in n)if(r(n[t],t,n)===er)break;return n},Qr=function(n,r){var t;if(!n||!vr[typeof n])return n;for(t in n)if(Rr.call(n,t)&&r(n[t],t,n)===er)break; -return n};A(/x/)&&(A=function(n){return typeof n=="function"&&"[object Function]"==Er.call(n)});var Xr=h(function(n,r,t){Rr.call(n,t)?n[t]++:n[t]=1}),Yr=h(function(n,r,t){(Rr.call(n,t)?n[t]:n[t]=[]).push(r)}),Zr=h(function(n,r,t){n[t]=r}),nt=M,rt=_(rt=Date.now)&&rt||function(){return(new Date).getTime()};u.after=function(n,r){if(!A(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},u.bind=L,u.bindAll=function(n){for(var r=1i(a,e)){for(r=t;--r;)if(0>i(n[r],e))continue n;a.push(e)}return a},u.invert=T,u.invoke=function(n,r){var t=e(arguments,2),u=-1,o=typeof r=="function",i=n?n.length:0,f=Array(typeof i=="number"?i:0);return D(n,function(n){f[++u]=(o?r:n[r]).apply(n,t)}),f},u.keys=Vr,u.map=M,u.max=$,u.memoize=function(n,r){var t={};return function(){var e=r?r.apply(this,arguments):ur+arguments[0];return Rr.call(t,e)?t[e]:t[e]=n.apply(this,arguments) -}},u.min=function(n,r,t){var e=1/0,u=e;typeof r!="function"&&t&&t[r]===n&&(r=null);var o=-1,i=n?n.length:0;if(null==r&&typeof i=="number")for(;++or?0:r);++nt?$r(0,e+t):Wr(t,e-1))+1);e--;)if(n[e]===r)return e; -return-1},u.mixin=Z,u.noConflict=function(){return mr._=Tr,this},u.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Sr(zr()*(r-n+1))},u.reduce=W,u.reduceRight=z,u.result=function(n,r){if(n){var t=n[r];return A(t)?n[r]():t}},u.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:Vr(n).length},u.some=P,u.sortedIndex=J,u.template=function(n,r,e){var o=u,i=o.templateSettings;n=(n||"")+"",e=j({},e,i);var f=0,a="__p+='",i=e.variable;n.replace(RegExp((e.escape||or).source+"|"+(e.interpolate||or).source+"|"+(e.evaluate||or).source+"|$","g"),function(r,e,u,o,i){return a+=n.slice(f,i).replace(ir,t),e&&(a+="'+_.escape("+e+")+'"),o&&(a+="';"+o+";\n__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),f=i+r.length,r -}),a+="';",i||(i="obj",a="with("+i+"||{}){"+a+"}"),a="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";try{var l=Function("_","return "+a)(o)}catch(c){throw c.source=a,c}return r?l(r):(l.source=a,l)},u.unescape=function(n){return null==n?"":(n+="",0>n.indexOf(";")?n:n.replace(Jr,d))},u.uniqueId=function(n){var r=++tr+"";return n?n+r:r},u.all=k,u.any=P,u.detect=q,u.findWhere=function(n,r){return U(n,r,true)},u.foldl=W,u.foldr=z,u.include=F,u.inject=W,u.first=V,u.last=function(n,r,t){var u=0,o=n?n.length:0; -if(typeof r!="number"&&null!=r){var i=o;for(r=X(r,t,3);i--&&r(n[i],i,n);)u++}else if(u=r,null==u||t)return n?n[o-1]:rr;return e(n,$r(0,o-u))},u.sample=function(n,r,t){return n&&typeof n.length!="number"&&(n=R(n)),null==r||t?n?n[0+Sr(zr()*(n.length-1-0+1))]:rr:(n=C(n),n.length=Wr($r(0,r),n.length),n)},u.take=V,u.head=V,Z(w({},u)),u.VERSION="2.4.1",u.prototype.chain=function(){return this.__chain__=true,this},u.prototype.value=function(){return this.__wrapped__},D("pop push reverse shift sort splice unshift".split(" "),function(n){var r=jr[n]; -u.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),Cr.spliceObjects||0!==n.length||delete n[0],this}}),D(["concat","join","slice"],function(n){var r=jr[n];u.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new o(n),n.__chain__=true),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(mr._=u, define(function(){return u})):_r&&dr?br?(dr.exports=u)._=u:_r._=u:mr._=u}).call(this); \ No newline at end of file +;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++tf||typeof i=="undefined")return 1;if(it?0:t);++ee(r,i)&&o.push(i)}return o}function p(n,r,t,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++eu(f,l))&&(t&&f.push(l),i.push(a))}return i}function h(n){return function(r,t,e){var u={};t=Y(t,e,3),e=-1;var o=r?r.length:0;if(typeof o=="number")for(;++eu&&(u=t);else r=Y(r,t,3),I(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function z(n,r,t,e){if(!n)return t;var u=3>arguments.length;r=Y(r,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(t=n[++o]);++oarguments.length; +return r=Y(r,e,4),M(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function P(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return I(n,function(n){var t;t=++r,t=0+Nr(Cr()*(t-0+1)),e[r]=e[t],e[t]=n}),e}function U(n,r,t){var e;r=Y(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++te?Wr(0,u+e):e||0}else if(e)return e=K(r,t),r[e]===t?e:-1;return n(r,t,e)}function J(n,r,t){if(typeof r!="number"&&null!=r){var u=0,o=-1,i=n?n.length:0;for(r=Y(r,t,3);++o>>1,t(n[e])=y;m?(u&&(u=clearTimeout(u)),c=i,o=n.apply(f,e)):u||(u=setTimeout(v,y))}return m&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(h,r)),t&&(m=true,o=n.apply(f,e)),!m||a||u||(e=f=null),o}}function Y(n,r,t){var e=typeof n;if(null==n||"function"==e)return a(n,r,t);if("object"!=e)return rr(n);var u=Gr(n); +return function(r){for(var t=u.length,e=false;t--&&(e=r[u[t]]===n[u[t]]););return e}}function Z(n){return n}function nr(n){I(T(n),function(r){var t=u[r]=n[r];u.prototype[r]=function(){var n=[this.__wrapped__];return Fr.apply(n,arguments),n=t.apply(u,n),this.__chain__?new o(n,true):n}})}function rr(n){return function(r){return r[n]}}var tr,er=0,ur={},or=+new Date+"",ir=/($^)/,fr=/['\n\r\t\u2028\u2029\\]/g,ar="[object Arguments]",lr="[object Array]",cr="[object Boolean]",pr="[object Date]",sr="[object Number]",gr="[object Object]",hr="[object RegExp]",vr="[object String]",yr={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},mr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},_r=yr[typeof window]&&window||this,dr=yr[typeof exports]&&exports&&!exports.nodeType&&exports,br=yr[typeof module]&&module&&!module.nodeType&&module,wr=br&&br.exports===dr&&dr,jr=yr[typeof global]&&global; +!jr||jr.global!==jr&&jr.window!==jr||(_r=jr);var xr=[],Tr=Object.prototype,Er=_r._,Ar=Tr.toString,Or=RegExp("^"+(Ar+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Sr=Math.ceil,Nr=Math.floor,Rr=Function.prototype.toString,kr=Tr.hasOwnProperty,Fr=xr.push,Br=Tr.propertyIsEnumerable,qr=_(qr=Object.create)&&qr,Dr=_(Dr=Array.isArray)&&Dr,Ir=_r.isFinite,Mr=_r.isNaN,$r=_($r=Object.keys)&&$r,Wr=Math.max,zr=Math.min,Cr=Math.random;o.prototype=u.prototype;var Pr={};!function(){var n={0:1,length:1}; +Pr.spliceObjects=(xr.splice.call(n,0,1),!n[0])}(1),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},qr||(f=function(){function n(){}return function(r){if(S(r)){n.prototype=r;var t=new n;n.prototype=null}return t||_r.Object()}}()),b(arguments)||(b=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&kr.call(n,"callee")&&!Br.call(n,"callee")||false});var Ur=Dr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ar.call(n)==lr||false +},Vr=function(n){var r,t=[];if(!n||!yr[typeof n])return t;for(r in n)kr.call(n,r)&&t.push(r);return t},Gr=$r?function(n){return S(n)?$r(n):[]}:Vr,Hr={"&":"&","<":"<",">":">",'"':""","'":"'"},Jr=E(Hr),Kr=RegExp("("+Gr(Jr).join("|")+")","g"),Lr=RegExp("["+Gr(Hr).join("")+"]","g"),Qr=function(n,r){var t;if(!n||!yr[typeof n])return n;for(t in n)if(r(n[t],t,n)===ur)break;return n};O(/x/)&&(O=function(n){return typeof n=="function"&&"[object Function]"==Ar.call(n)});var Xr=h(function(n,r,t){kr.call(n,t)?n[t]++:n[t]=1 +}),Yr=h(function(n,r,t){(kr.call(n,t)?n[t]:n[t]=[]).push(r)}),Zr=h(function(n,r,t){n[t]=r}),nt=$,rt=_(rt=Date.now)&&rt||function(){return(new Date).getTime()};u.after=function(n,r){if(!O(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},u.bind=Q,u.bindAll=function(n){for(var r=1i(a,e)){for(r=t;--r;)if(0>i(n[r],e))continue n; +a.push(e)}return a},u.invert=E,u.invoke=function(n,r){var t=e(arguments,2),u=-1,o=typeof r=="function",i=n?n.length:0,f=Array(typeof i=="number"?i:0);return I(n,function(n){f[++u]=(o?r:n[r]).apply(n,t)}),f},u.keys=Gr,u.map=$,u.max=W,u.memoize=function(n,r){var t={};return function(){var e=r?r.apply(this,arguments):or+arguments[0];return kr.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}},u.min=function(n,r,t){var e=1/0,u=e;typeof r!="function"&&t&&t[r]===n&&(r=null);var o=-1,i=n?n.length:0;if(null==r&&typeof i=="number")for(;++or?0:r);++nt?Wr(0,e+t):zr(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},u.mixin=nr,u.noConflict=function(){return _r._=Er,this},u.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Nr(Cr()*(r-n+1)) +},u.reduce=z,u.reduceRight=C,u.result=function(n,r){if(n){var t=n[r];return O(t)?n[r]():t}},u.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:Gr(n).length},u.some=U,u.sortedIndex=K,u.template=function(n,r,e){var o=u,i=o.templateSettings;n=(n||"")+"",e=j({},e,i);var f=0,a="__p+='",i=e.variable;n.replace(RegExp((e.escape||ir).source+"|"+(e.interpolate||ir).source+"|"+(e.evaluate||ir).source+"|$","g"),function(r,e,u,o,i){return a+=n.slice(f,i).replace(fr,t),e&&(a+="'+_.escape("+e+")+'"),o&&(a+="';"+o+";\n__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),f=i+r.length,r +}),a+="';",i||(i="obj",a="with("+i+"||{}){"+a+"}"),a="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";try{var l=Function("_","return "+a)(o)}catch(c){throw c.source=a,c}return r?l(r):(l.source=a,l)},u.unescape=function(n){return null==n?"":(n+="",0>n.indexOf(";")?n:n.replace(Kr,d))},u.uniqueId=function(n){var r=++er+"";return n?n+r:r},u.all=B,u.any=U,u.detect=D,u.findWhere=function(n,r){return V(n,r,true)},u.foldl=z,u.foldr=C,u.include=F,u.inject=z,u.first=G,u.last=function(n,r,t){var u=0,o=n?n.length:0; +if(typeof r!="number"&&null!=r){var i=o;for(r=Y(r,t,3);i--&&r(n[i],i,n);)u++}else if(u=r,null==u||t)return n?n[o-1]:tr;return e(n,Wr(0,o-u))},u.sample=function(n,r,t){return n&&typeof n.length!="number"&&(n=k(n)),null==r||t?n?n[0+Nr(Cr()*(n.length-1-0+1))]:tr:(n=P(n),n.length=zr(Wr(0,r),n.length),n)},u.take=G,u.head=G,nr(w({},u)),u.VERSION="2.4.1",u.prototype.chain=function(){return this.__chain__=true,this},u.prototype.value=function(){return this.__wrapped__},I("pop push reverse shift sort splice unshift".split(" "),function(n){var r=xr[n]; +u.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),Pr.spliceObjects||0!==n.length||delete n[0],this}}),I(["concat","join","slice"],function(n){var r=xr[n];u.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new o(n),n.__chain__=true),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(_r._=u, define(function(){return u})):dr&&br?wr?(br.exports=u)._=u:dr._=u:_r._=u}).call(this); \ No newline at end of file diff --git a/lodash.js b/lodash.js index d1e1eda27..5f8d8edaa 100644 --- a/lodash.js +++ b/lodash.js @@ -950,8 +950,8 @@ // iterate own properties using `Object.keys` ' <% if (useHas && keys) { %>\n' + ' var ownIndex = -1,\n' + - ' ownProps = objectTypes[typeof iterable] && keys(iterable),\n' + - ' length = ownProps ? ownProps.length : 0;\n\n' + + ' ownProps = keys(iterable),\n' + + ' length = ownProps.length;\n\n' + ' while (++ownIndex < length) {\n' + ' index = ownProps[ownIndex];\n<%' + " if (conditions.length) { %> if (<%= conditions.join(' && ') %>) {\n <% } %>" + @@ -2001,27 +2001,6 @@ 'loop': 'if (callback(iterable[index], index, collection) === false) return result' }; - /** Reusable iterator options for `assign` and `defaults` */ - var defaultsIteratorOptions = { - 'args': 'object, source, guard', - 'top': - 'var args = arguments,\n' + - ' argsIndex = 0,\n' + - " argsLength = typeof guard == 'number' ? 2 : args.length;\n" + - 'while (++argsIndex < argsLength) {\n' + - ' iterable = args[argsIndex];\n' + - ' if (iterable && objectTypes[typeof iterable]) {', - 'keys': keys, - 'loop': "if (typeof result[index] == 'undefined') result[index] = iterable[index]", - 'bottom': ' }\n}' - }; - - /** Reusable iterator options for `forIn` and `forOwn` */ - var forOwnIteratorOptions = { - 'top': 'if (!objectTypes[typeof iterable]) return result;\n' + eachIteratorOptions.top, - 'array': false - }; - /** * Used to convert characters to HTML entities: * @@ -2093,18 +2072,31 @@ * defaults(object, { 'name': 'fred', 'employer': 'slate' }); * // => { 'name': 'barney', 'employer': 'slate' } */ - var assign = createIterator(defaultsIteratorOptions, { - 'top': - defaultsIteratorOptions.top.replace(';', - ';\n' + - "if (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n" + - ' var callback = baseCreateCallback(args[--argsLength - 1], args[argsLength--], 2);\n' + - "} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n" + - ' callback = args[--argsLength];\n' + - '}' - ), - 'loop': 'result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]' - }); + function assign(object, source, guard) { + var args = arguments, + argsIndex = 0, + argsLength = typeof guard == 'number' ? 2 : args.length; + + if (argsLength > 3 && typeof args[argsLength - 2] == 'function') { + var callback = baseCreateCallback(args[--argsLength - 1], args[argsLength--], 2); + } else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') { + callback = args[--argsLength]; + } + while (++argsIndex < argsLength) { + source = args[argsIndex]; + if (isObject(source)) { + var index = -1, + props = keys(source), + length = props.length; + + while (++index < length) { + var key = props[index]; + object[key] = callback ? callback(object[key], source[key]) : source[key]; + } + } + } + return object; + } /** * Creates a clone of `value`. If `isDeep` is `true` nested objects will also @@ -2258,7 +2250,28 @@ * _.defaults(object, { 'name': 'fred', 'employer': 'slate' }); * // => { 'name': 'barney', 'employer': 'slate' } */ - var defaults = createIterator(defaultsIteratorOptions); + function defaults(object, source, guard) { + var args = arguments, + argsIndex = 0, + argsLength = typeof guard == 'number' ? 2 : args.length; + + while (++argsIndex < argsLength) { + source = args[argsIndex]; + if (isObject(source)) { + var index = -1, + props = keys(source), + length = props.length; + + while (++index < length) { + var key = props[index]; + if (typeof object[key] == 'undefined') { + object[key] = source[key]; + } + } + } + } + return object; + } /** * This method is like `_.findIndex` except that it returns the key of the @@ -2397,7 +2410,9 @@ * }); * // => logs 'x', 'y', and 'move' (property order is not guaranteed across environments) */ - var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, { + var forIn = createIterator(eachIteratorOptions, { + 'top': 'if (!objectTypes[typeof iterable]) return result;\n' + eachIteratorOptions.top, + 'array': false, 'useHas': false }); @@ -2467,7 +2482,20 @@ * }); * // => logs '0', '1', and 'length' (property order is not guaranteed across environments) */ - var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions); + function forOwn(object, callback, thisArg) { + var index = -1, + props = keys(object), + length = props.length; + + callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3); + while (++index < length) { + var key = props[index]; + if (callback(object[key], key, object) === false) { + break; + } + } + return object; + } /** * This method is like `_.forOwn` except that it iterates over elements