From 83fb9f84edd5622cd21f48dd58190e023c916032 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 18 Feb 2014 23:10:31 -0800 Subject: [PATCH] Rebuild docs & dist. --- dist/lodash.compat.js | 83 ++++++----- dist/lodash.compat.min.js | 54 +++---- dist/lodash.js | 83 ++++++----- dist/lodash.min.js | 40 ++--- dist/lodash.underscore.js | 76 +++++----- dist/lodash.underscore.min.js | 54 +++---- doc/README.md | 266 +++++++++++++++++----------------- 7 files changed, 339 insertions(+), 317 deletions(-) diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 0cdfc7674..746693c49 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -1063,10 +1063,16 @@ // `Function#bind` spec // http://es5.github.io/#x15.3.4.5 if (partialArgs) { - // avoid `arguments` object deoptimizations by using `slice` instead - // of `Array.prototype.slice.call` and not assigning `arguments` to a - // variable as a ternary expression - var args = composeArgs(partialArgs, partialHolders, arguments); + // avoid `arguments` object use disqualifying optimizations by + // converting it to an array before passing it to `composeArgs` + var index = -1, + length = arguments.length, + args = Array(length); + + while (++index < length) { + args[index] = arguments[index]; + } + args = composeArgs(partialArgs, partialHolders, args); } // mimic the constructor's `return` behavior // http://es5.github.io/#x13.2.2 @@ -1282,27 +1288,29 @@ key = func; function bound() { - var thisBinding = isBind ? thisArg : this; + var index = -1, + length = arguments.length, + args = Array(length); + + while (++index < length) { + args[index] = arguments[index]; + } if (partialArgs) { - var args = composeArgs(partialArgs, partialHolders, arguments); + args = composeArgs(partialArgs, partialHolders, args); } if (partialRightArgs) { - args = composeArgsRight(partialRightArgs, partialRightHolders, args || arguments); + args = composeArgsRight(partialRightArgs, partialRightHolders, args); } - if (isCurry) { - var argsLength = arguments.length; - if (argsLength < arity) { - args || (args = slice(arguments)); - bitmask |= PARTIAL_FLAG; - bitmask &= ~PARTIAL_RIGHT_FLAG - if (!isCurryBound) { - bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); - } - var newArity = nativeMax(0, arity - argsLength); - return baseCreateWrapper([func, bitmask, newArity, thisArg, args, null, []]); + if (isCurry && length < arity) { + bitmask |= PARTIAL_FLAG; + bitmask &= ~PARTIAL_RIGHT_FLAG + if (!isCurryBound) { + bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); } + var newArity = nativeMax(0, arity - length); + return baseCreateWrapper([func, bitmask, newArity, thisArg, args, null, []]); } - args || (args = arguments); + var thisBinding = isBind ? thisArg : this; if (isBindKey) { func = thisBinding[key]; } @@ -1795,21 +1803,21 @@ * @returns {Array} Returns a new array of composed arguments. */ function composeArgs(partialArgs, partialHolders, args) { - var index = -1, - length = partialHolders.length, + var holdersLength = partialHolders.length, + argsIndex = -1, + argsLength = nativeMax(args.length - holdersLength, 0), leftIndex = -1, leftLength = partialArgs.length, - argsLength = nativeMax(args.length - length, 0), result = Array(argsLength + leftLength); while (++leftIndex < leftLength) { result[leftIndex] = partialArgs[leftIndex]; } - while (++index < length) { - result[partialHolders[index]] = args[index]; + while (++argsIndex < holdersLength) { + result[partialHolders[argsIndex]] = args[argsIndex]; } - while (length < argsLength) { - result[leftIndex++] = args[length++]; + while (argsLength--) { + result[leftIndex++] = args[argsIndex++]; } return result; } @@ -1825,10 +1833,10 @@ * @returns {Array} Returns a new array of composed arguments. */ function composeArgsRight(partialRightArgs, partialRightHolders, args) { - var index = -1, - length = partialRightHolders.length, + var holdersIndex = -1, + holdersLength = partialRightHolders.length, argsIndex = -1, - argsLength = nativeMax(args.length - length, 0), + argsLength = nativeMax(args.length - holdersLength, 0), rightIndex = -1, rightLength = partialRightArgs.length, result = Array(argsLength + rightLength); @@ -1840,8 +1848,8 @@ while (++rightIndex < rightLength) { result[pad + rightIndex] = partialRightArgs[rightIndex]; } - while (++index < length) { - result[pad + partialHolders[index]] = args[argsIndex++]; + while (++holdersIndex < holdersLength) { + result[pad + partialRightHolders[holdersIndex]] = args[argsIndex++]; } return result; } @@ -2756,14 +2764,13 @@ * // => [1, 1] */ function pull(array) { - var args = arguments, - argsIndex = 0, - argsLength = args.length, + var argsIndex = 0, + argsLength = arguments.length, length = array ? array.length : 0; while (++argsIndex < argsLength) { var index = -1, - value = args[argsIndex]; + value = arguments[argsIndex]; while (++index < length) { if (array[index] === value) { @@ -6725,7 +6732,7 @@ /** * Creates a compiled template function that can interpolate data properties - * in "interpolate" delimiters, HTML escape interpolated data properties in + * in "interpolate" delimiters, HTML-escaped interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. If * a data object is provided the interpolated template string will be returned. * Data properties may be accessed as free variables in the template. If a @@ -6754,8 +6761,8 @@ * @param {RegExp} [options.interpolate] The "interpolate" delimiter. * @param {string} [options.sourceURL] The sourceURL of the template's compiled source. * @param {string} [options.variable] The data object variable name. - * @returns {Function|string} Returns the interpolated text if a data object - * if a data object is given, else it returns a template function. + * @returns {Function|string} Returns the interpolated string if a data object + * is provided, else it returns a template function. * @example * * // using the "interpolate" delimiter to create a compiled template diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index 2d402018c..5a48733c9 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -4,62 +4,62 @@ * Build: `lodash -o ./dist/lodash.compat.js` */ ;(function(){function n(n,t){if(n!==t){if(n>t||typeof n=="undefined")return 1;if(ne||13e||8202r||13r||8202=S&&(o=r,e=pe(e));++uo(e,l)&&i.push(l)}return i}function ht(n,t){var r=-1,e=n,u=n?n.length:0;if(typeof u=="number")for(ce.unindexedChars&&fr(e)&&(e=e.split(""));++r=S&&(o=r,e=pe(e));++uo(e,l)&&i.push(l)}return i}function ht(n,t){var r=-1,e=n,u=n?n.length:0;if(typeof u=="number")for(ce.unindexedChars&&fr(e)&&(e=e.split(""));++r=S,f=[];if(l)var p=pe(),a=r;else p=u?c():f;for(;++oa(p,h))&&((u||l)&&p.push(h),f.push(g)) -}return!l&&u&&s(p),f}function kt(n,t,r){for(var e=-1,u=t.length,o=-1,a=n.length,i=ne(r.length-u,0),l=mr(i+a);++or&&(r=0),c&&(a=[]),p&&(i=[]),s=[n,t,r,e,u,o,a,i],t==j||t==(j|O)?m(s):st(s))}function St(n){n.d=Y;var t=_r,r="return function("+n.a+"){",e="var r="+n.b+";if(!j(p)){return r}";ce.nonEnumArgs&&(e+="var m=p.length;if(m&&i(p)){l=-1;while(++lu;u++)e+="l='"+n.d[u]+"';if((!(k&&n[l])&&g.call(p,l))",n.e||(e+="||(!n[l]&&p[l]!==q[l])"),e+="){"+n.c+"}";e+="}"}return t("e,f,g,i,j,q,o,u,v,w",r+(e+"return r;")+"}")(et,Sr,Dr,Rt,ir,Ar,fe,lt,Ir,Tr) }function At(){var n=(n=u.indexOf)===Pt?t:n;return n}function It(n){return typeof n=="function"&&Pr.test(Lr.call(n))}function Nt(n){var t,r;return!n||Tr.call(n)!=at||!Dr.call(n,"constructor")&&(t=n.constructor,ar(t)&&!(t instanceof t))||!ce.argsClass&&Rt(n)||!ce.nodeClass&&p(n)?false:ce.ownLast?(ge(n,function(n,t,e){return r=Dr.call(e,t),false}),false!==r):(ge(n,function(n,t){r=t}),typeof r=="undefined"||Dr.call(n,r))}function Rt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Tr.call(n)==Z||false }function Tt(n,t,r){var e=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=-1;for(t=u.createCallback(t,r,3);++ae?ne(0,u+e):e||0;else if(e)return e=$t(n,r),u&&n[e]===r?e:-1;return t(n,r,e)}function qt(n,t,r){if(typeof t!="number"&&null!=t){var e=0,o=-1,a=n?n.length:0;for(t=u.createCallback(t,r,3);++ot?t=ne(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=ne(u+r,0):r>u&&(r=u),u=r-t||0,r=mr(u);++e>>1,r(n[e])r?0:r);++t=e)return false;if(typeof n=="string"||!_e(n)&&fr(n))return Xr?Xr.call(n,t,r):-1r?0:r);++t=e)return false;if(typeof n=="string"||!_e(n)&&fr(n))return Gr?Gr.call(n,t,r):-1r?ne(0,e+r):r)||0,-1a&&(a=l)}else t=null==t&&fr(n)?e:u.createCallback(t,r,3),ht(n,function(n,r,e){r=t(n,r,e),r>o&&(o=r,a=n)});return a}function Jt(n,t,r,e){var o=3>arguments.length;if(t=u.createCallback(t,e,4),_e(n)){var a=-1,i=n.length;for(o&&i&&(r=n[++a]);++aa&&(a=l)}else t=null==t&&fr(n)?e:u.createCallback(t,r,3),ht(n,function(n,r,e){r=t(n,r,e),r>o&&(o=r,a=n)});return a}function Jt(n,t,r,e){var o=3>arguments.length;if(t=u.createCallback(t,e,4),_e(n)){var a=-1,i=n.length;for(o&&i&&(r=n[++a]);++aarguments.length;return t=u.createCallback(t,e,4),vt(n,function(n,e,u){r=o?(o=false,n):t(r,n,e,u)}),r}function Yt(n){var t=-1,r=n?n.length:0,e=mr(typeof r=="number"?r:0);return ht(n,function(n){var r=xt(0,++t);e[t]=e[r],e[r]=n}),e}function Zt(n,t,r){var e;if(t=u.createCallback(t,r,3),_e(n)){r=-1;for(var o=n.length;++rarguments.length)return Et(n,j,null,t); if(n)var r=n[N]?n[N][2]:n.length,e=Ft(arguments,2),r=r-e.length;return Et(n,j|O,r,t,e)}function tr(n,t,r){var e,u,o,a,i,l,f,c=0,p=false,s=true;if(!ar(n))throw new Or;if(t=ne(0,t)||0,true===r)var g=true,s=false;else ir(r)&&(g=r.leading,p="maxWait"in r&&(ne(t,r.maxWait)||0),s="trailing"in r?r.trailing:s);var h=function(){var r=t-(Oe()-a);0>=r||r>t?(u&&Fr(u),r=f,u=l=f=w,r&&(c=Oe(),o=n.apply(i,e),l||u||(e=i=null))):l=Mr(h,r)},v=function(){l&&Fr(l),u=l=f=w,(s||p!==t)&&(c=Oe(),o=n.apply(i,e),l||u||(e=i=null))};return function(){if(e=arguments,a=Oe(),i=this,f=s&&(l||!g),false===p)var r=g&&!l; -else{u||g||(c=a);var y=p-(a-c),m=0>=y||y>p;m?(u&&(u=Fr(u)),c=a,o=n.apply(i,e)):u||(u=Mr(v,y))}return m&&l?l=Fr(l):l||t===p||(l=Mr(h,t)),r&&(m=true,o=n.apply(i,e)),!m||l||u||(e=i=null),o}}function rr(n,t,r){var e=arguments,u=0,o=e.length,a=typeof r;if("number"!=a&&"string"!=a||!e[3]||e[3][r]!==t||(o=2),3=y||y>p;m?(u&&(u=Fr(u)),c=a,o=n.apply(i,e)):u||(u=Mr(v,y))}return m&&l?l=Fr(l):l||t===p||(l=Mr(h,t)),r&&(m=true,o=n.apply(i,e)),!m||l||u||(e=i=null),o}}function rr(n,t,r){var e=arguments,u=0,o=e.length,a=typeof r;if("number"!=a&&"string"!=a||!e[3]||e[3][r]!==t||(o=2),3--n?t.apply(this,arguments):void 0}},u.assign=rr,u.at=function(n,t){var r=arguments,e=-1,u=mt(r,true,false,1),o=u.length,a=typeof t;for("number"!=a&&"string"!=a||!r[2]||r[2][t]!==n||(o=1),ce.unindexedChars&&fr(n)&&(n=n.split("")),r=mr(o);++e--n?t.apply(this,arguments):void 0}},u.assign=rr,u.at=function(n,t){var r=arguments,e=-1,u=mt(r,true,false,1),o=u.length,a=typeof t;for("number"!=a&&"string"!=a||!r[2]||r[2][t]!==n||(o=1),ce.unindexedChars&&fr(n)&&(n=n.split("")),r=mr(o);++earguments.length?Et(t,j|x,null,n):Et(t,j|x|O,null,n,Ft(arguments,2))},u.chain=function(n){return n=new o(n),n.__chain__=true,n},u.compact=function(n){for(var t=-1,r=n?n.length:0,e=0,u=[];++t=S&&pe(e?n[e]:l)))}var i=n[0],p=-1,g=i?i.length:0,h=[]; +return"boolean"!=u&&null!=t&&(e=r,r=t,t=false,"number"!=u&&"string"!=u||!e||e[r]!==n||(r=null)),null!=r&&(n=Gt(n,r,e)),mt(n,t)},u.forEach=Vt,u.forEachRight=Xt,u.forIn=function(n,t,r){return t=t&&typeof r=="undefined"?t:H(t,r,3),ge(n,t)},u.forInRight=function(n,t,r){var e=[];ge(n,function(n,t){e.push(t,n)});var u=e.length;for(t=H(t,r,3);u--&&false!==t(e[u--],e[u],n););return n},u.forOwn=function(n,t,r){return t=t&&typeof r=="undefined"?t:H(t,r,3),dt(n,t)},u.forOwnRight=function(n,t,r){var e=je(n),u=e.length; +for(t=H(t,r,3);u--&&(r=e[u],false!==t(n[r],r,n)););return n},u.functions=ur,u.groupBy=ye,u.indexBy=me,u.initial=function(n,t,r){var e=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=o;for(t=u.createCallback(t,r,3);a--&&t(n[a],a,n);)e++}else e=null==t||r?1:t||e;return e=o-e,Ft(n,0,0=S&&pe(e?n[e]:l)))}var i=n[0],p=-1,g=i?i.length:0,h=[]; n:for(;++p(v?r(v,f):a(l,f))){for(e=u,(v||l).push(f);--e;)if(v=o[e],0>(v?r(v,f):a(n[e],f)))continue n;h.push(f)}}return s(o),s(l),h},u.invert=function(n,t){for(var r=-1,e=je(n),u=e.length,o={};++rarguments.length&&_e(n))for(;++rr?ne(0,e+r):te(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},u.mixin=hr,u.noConflict=function(){return n._=Rr,this},u.noop=vr,u.now=Oe,u.parseInt=Ee,u.random=function(n,t,r){var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=ue(),te(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):xt(n,t) },u.reduce=Jt,u.reduceRight=Qt,u.result=function(n,t,r){var e=null==n?w:n[t];return typeof e=="undefined"?r:ar(e)?n[t]():e},u.runInContext=_,u.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:je(n).length},u.some=Zt,u.sortedIndex=$t,u.template=function(n,t,r){var e=u.templateSettings;n=kr(n||""),r=er({},r,e);var o,a=er({},r.imports,e.imports),e=je(a),a=cr(a),i=0,l=r.interpolate||U,c="__p+='",l=Cr((r.escape||U).source+"|"+l.source+"|"+(l===D?W:U).source+"|"+(r.evaluate||U).source+"|$","g"); -n.replace(l,function(t,r,e,u,a,l){return e||(e=u),c+=n.slice(i,l).replace(H,f),r&&(c+="'+__e("+r+")+'"),a&&(o=true,c+="';"+a+";\n__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),i=l+t.length,t}),c+="';",l=r=r.variable,l||(r="obj",c="with("+r+"){"+c+"}"),c=(o?c.replace(T,""):c).replace(P,"$1").replace(q,"$1;"),c="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var p=_r(e,"return "+c).apply(w,a) +n.replace(l,function(t,r,e,u,a,l){return e||(e=u),c+=n.slice(i,l).replace(X,f),r&&(c+="'+__e("+r+")+'"),a&&(o=true,c+="';"+a+";\n__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),i=l+t.length,t}),c+="';",l=r=r.variable,l||(r="obj",c="with("+r+"){"+c+"}"),c=(o?c.replace(T,""):c).replace(P,"$1").replace(q,"$1;"),c="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var p=_r(e,"return "+c).apply(w,a) }catch(s){throw s.source=c,s}return t?p(t):(p.source=c,p)},u.trim=xe,u.trimLeft=Ce,u.trimRight=ke,u.unescape=function(n){return null==n?"":(n=kr(n),0>n.indexOf(";")?n:n.replace(F,b))},u.uniqueId=function(n){var t=++R;return kr(null==n?"":n)+t},u.all=Kt,u.any=Zt,u.detect=Ut,u.findWhere=Ut,u.foldl=Jt,u.foldr=Qt,u.include=zt,u.inject=Jt,hr(function(){var n={};return dt(u,function(t,r){u.prototype[r]||(n[r]=t)}),n}(),false),u.first=Tt,u.last=function(n,t,r){var e=0,o=n?n.length:0;if(typeof t!="number"&&null!=t){var a=o; for(t=u.createCallback(t,r,3);a--&&t(n[a],a,n);)e++}else if(e=t,null==e||r)return n?n[o-1]:w;return e=o-e,Ft(n,0"']/g,L=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,D=/<%=([\s\S]+?)%>/g,W=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,z=/\w*$/,K=/^\s*function[ \n\r\t]+\w/,M=/^0[xX]/,U=/($^)/,V=/\bthis\b/,H=/['\n\r\t\u2028\u2029\\]/g,X=" \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",G=[],J=[],Q="Array Boolean Date Error Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),Y="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),Z="[object Arguments]",nt="[object Array]",tt="[object Boolean]",rt="[object Date]",et="[object Error]",ut="[object Function]",ot="[object Number]",at="[object Object]",it="[object RegExp]",lt="[object String]",ft={}; +u.prototype[n]=function(){return new o(t.apply(this.__wrapped__,arguments),this.__chain__)}}),ce.spliceObjects||ht(["pop","shift","splice"],function(n){var t=Er[n],r="splice"==n;u.prototype[n]=function(){var n=this.__chain__,e=this.__wrapped__,u=t.apply(e,arguments);return 0===e.length&&delete e[0],n||r?new o(u,n):u}}),u}var w,j=1,x=2,C=4,k=8,O=16,E=32,S=40,A=40,I="2.4.1",N="__lodash@"+I+"__",R=0,T=/\b__p\+='';/g,P=/\b(__p\+=)''\+/g,q=/(__e\(.*?\)|\b__t\))\+'';/g,F=/&(?:amp|lt|gt|quot|#39);/g,$=/[&<>"']/g,L=/<%-([\s\S]+?)%>/g,B=/<%([\s\S]+?)%>/g,D=/<%=([\s\S]+?)%>/g,W=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,z=/\w*$/,K=/^\s*function[ \n\r\t]+\w/,M=/^0[xX]/,U=/($^)/,V=/\bthis\b/,X=/['\n\r\t\u2028\u2029\\]/g,G=" \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",H=[],J=[],Q="Array Boolean Date Error Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),Y="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),Z="[object Arguments]",nt="[object Array]",tt="[object Boolean]",rt="[object Date]",et="[object Error]",ut="[object Function]",ot="[object Number]",at="[object Object]",it="[object RegExp]",lt="[object String]",ft={}; ft[ut]=false,ft[Z]=ft[nt]=ft[tt]=ft[rt]=ft[ot]=ft[at]=ft[it]=ft[lt]=true;var ct={leading:false,maxWait:0,trailing:false},pt={configurable:false,enumerable:false,value:null,writable:false},st={"&":"&","<":"<",">":">",'"':""","'":"'"},gt={"&":"&","<":"<",">":">",""":'"',"'":"'"},ht={"function":true,object:true},vt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},yt=ht[typeof window]&&window||this,mt=ht[typeof exports]&&exports&&!exports.nodeType&&exports,ht=ht[typeof module]&&module&&!module.nodeType&&module,dt=mt&&ht&&typeof global=="object"&&global; !dt||dt.global!==dt&&dt.window!==dt&&dt.self!==dt||(yt=dt);var dt=ht&&ht.exports===mt&&mt,bt=_();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(yt._=bt, define(function(){return bt})):mt&&ht?dt?(ht.exports=bt)._=bt:mt._=bt:yt._=bt}).call(this); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index 504d3c1da..2ee535c33 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -841,10 +841,16 @@ // `Function#bind` spec // http://es5.github.io/#x15.3.4.5 if (partialArgs) { - // avoid `arguments` object deoptimizations by using `slice` instead - // of `Array.prototype.slice.call` and not assigning `arguments` to a - // variable as a ternary expression - var args = composeArgs(partialArgs, partialHolders, arguments); + // avoid `arguments` object use disqualifying optimizations by + // converting it to an array before passing it to `composeArgs` + var index = -1, + length = arguments.length, + args = Array(length); + + while (++index < length) { + args[index] = arguments[index]; + } + args = composeArgs(partialArgs, partialHolders, args); } // mimic the constructor's `return` behavior // http://es5.github.io/#x13.2.2 @@ -1060,27 +1066,29 @@ key = func; function bound() { - var thisBinding = isBind ? thisArg : this; + var index = -1, + length = arguments.length, + args = Array(length); + + while (++index < length) { + args[index] = arguments[index]; + } if (partialArgs) { - var args = composeArgs(partialArgs, partialHolders, arguments); + args = composeArgs(partialArgs, partialHolders, args); } if (partialRightArgs) { - args = composeArgsRight(partialRightArgs, partialRightHolders, args || arguments); + args = composeArgsRight(partialRightArgs, partialRightHolders, args); } - if (isCurry) { - var argsLength = arguments.length; - if (argsLength < arity) { - args || (args = slice(arguments)); - bitmask |= PARTIAL_FLAG; - bitmask &= ~PARTIAL_RIGHT_FLAG - if (!isCurryBound) { - bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); - } - var newArity = nativeMax(0, arity - argsLength); - return baseCreateWrapper([func, bitmask, newArity, thisArg, args, null, []]); + if (isCurry && length < arity) { + bitmask |= PARTIAL_FLAG; + bitmask &= ~PARTIAL_RIGHT_FLAG + if (!isCurryBound) { + bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); } + var newArity = nativeMax(0, arity - length); + return baseCreateWrapper([func, bitmask, newArity, thisArg, args, null, []]); } - args || (args = arguments); + var thisBinding = isBind ? thisArg : this; if (isBindKey) { func = thisBinding[key]; } @@ -1567,21 +1575,21 @@ * @returns {Array} Returns a new array of composed arguments. */ function composeArgs(partialArgs, partialHolders, args) { - var index = -1, - length = partialHolders.length, + var holdersLength = partialHolders.length, + argsIndex = -1, + argsLength = nativeMax(args.length - holdersLength, 0), leftIndex = -1, leftLength = partialArgs.length, - argsLength = nativeMax(args.length - length, 0), result = Array(argsLength + leftLength); while (++leftIndex < leftLength) { result[leftIndex] = partialArgs[leftIndex]; } - while (++index < length) { - result[partialHolders[index]] = args[index]; + while (++argsIndex < holdersLength) { + result[partialHolders[argsIndex]] = args[argsIndex]; } - while (length < argsLength) { - result[leftIndex++] = args[length++]; + while (argsLength--) { + result[leftIndex++] = args[argsIndex++]; } return result; } @@ -1597,10 +1605,10 @@ * @returns {Array} Returns a new array of composed arguments. */ function composeArgsRight(partialRightArgs, partialRightHolders, args) { - var index = -1, - length = partialRightHolders.length, + var holdersIndex = -1, + holdersLength = partialRightHolders.length, argsIndex = -1, - argsLength = nativeMax(args.length - length, 0), + argsLength = nativeMax(args.length - holdersLength, 0), rightIndex = -1, rightLength = partialRightArgs.length, result = Array(argsLength + rightLength); @@ -1612,8 +1620,8 @@ while (++rightIndex < rightLength) { result[pad + rightIndex] = partialRightArgs[rightIndex]; } - while (++index < length) { - result[pad + partialHolders[index]] = args[argsIndex++]; + while (++holdersIndex < holdersLength) { + result[pad + partialRightHolders[holdersIndex]] = args[argsIndex++]; } return result; } @@ -2493,14 +2501,13 @@ * // => [1, 1] */ function pull(array) { - var args = arguments, - argsIndex = 0, - argsLength = args.length, + var argsIndex = 0, + argsLength = arguments.length, length = array ? array.length : 0; while (++argsIndex < argsLength) { var index = -1, - value = args[argsIndex]; + value = arguments[argsIndex]; while (++index < length) { if (array[index] === value) { @@ -6446,7 +6453,7 @@ /** * Creates a compiled template function that can interpolate data properties - * in "interpolate" delimiters, HTML escape interpolated data properties in + * in "interpolate" delimiters, HTML-escaped interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. If * a data object is provided the interpolated template string will be returned. * Data properties may be accessed as free variables in the template. If a @@ -6475,8 +6482,8 @@ * @param {RegExp} [options.interpolate] The "interpolate" delimiter. * @param {string} [options.sourceURL] The sourceURL of the template's compiled source. * @param {string} [options.variable] The data object variable name. - * @returns {Function|string} Returns the interpolated text if a data object - * if a data object is given, else it returns a template function. + * @returns {Function|string} Returns the interpolated string if a data object + * is provided, else it returns a template function. * @example * * // using the "interpolate" delimiter to create a compiled template diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 9ce8698bd..2e504148d 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -4,58 +4,58 @@ * Build: `lodash modern -o ./dist/lodash.js` */ ;(function(){function n(n,t){if(n!==t){if(n>t||typeof n=="undefined")return 1;if(ne||13e||8202r||13r||8202=A&&(o=r,e=ae(e));++uo(e,f)&&a.push(f)}return a}function ht(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(;++r=A,l=[];if(f)var s=ae(),i=r;else s=u?c():l;for(;++oi(s,h))&&((u||f)&&s.push(h),l.push(g)) -}return!f&&u&&p(s),l}function xt(n,t,r){for(var e=-1,u=t.length,o=-1,i=n.length,a=Jr(r.length-u,0),f=vr(a+i);++or&&(r=0),c&&(i=[]),p&&(a=[]),s=[n,t,r,e,u,o,i,a],t==w||t==(w|C)?S(s):pt(s))}function At(){var n=(n=y.indexOf)===It?t:n;return n}function St(n){return typeof n=="function"&&Rr.test($r.call(n))}function Et(n){var t,r;return n&&Nr.call(n)==et&&(Dr.call(n,"constructor")||(t=n.constructor,!ur(t)||t instanceof t))?(o(n,function(n,t){r=t }),typeof r=="undefined"||Dr.call(n,r)):false}function Nt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Nr.call(n)==Q||false}function Rt(n,t,r){var e=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=y.createCallback(t,r,3);++oe?Jr(0,u+e):e||0;else if(e)return e=$t(n,r),u&&n[e]===r?e:-1;return t(n,r,e)}function Tt(n,t,r){if(typeof t!="number"&&null!=t){var e=0,u=-1,o=n?n.length:0; for(t=y.createCallback(t,r,3);++ut?t=Jr(u+t,0):t>u&&(t=u),typeof r=="undefined"?r=u:0>r?r=Jr(u+r,0):r>u&&(r=u),u=r-t||0,r=vr(u);++e>>1,r(n[e])r?0:r);++t=e)return false;if(typeof n=="string"||!he(n)&&ar(n))return Mr?Mr.call(n,t,r):-1r?0:r);++t=e)return false;if(typeof n=="string"||!he(n)&&ar(n))return Mr?Mr.call(n,t,r):-1r?Jr(0,e+r):r)||0,-1o&&(o=a)}else t=null==t&&ar(n)?e:y.createCallback(t,r,3),ht(n,function(n,r,e){r=t(n,r,e),r>u&&(u=r,o=n)});return o}function Xt(n,t,r,e){var u=3>arguments.length; -t=y.createCallback(t,e,4);var o=-1,i=n?n.length:0;if(typeof i=="number")for(u&&i&&(r=n[++o]);++oarguments.length;return t=y.createCallback(t,e,4),vt(n,function(n,e,o){r=u?(u=false,n):t(r,n,e,o)}),r}function Jt(n){var t=-1,r=n?n.length:0,e=vr(typeof r=="number"?r:0);return ht(n,function(n){var r=kt(0,++t);e[t]=e[r],e[r]=n}),e}function Qt(n,t,r){var e;t=y.createCallback(t,r,3),r=-1;var u=n?n.length:0; +return n}function Vt(n,t,r){var e=-1,u=n?n.length:0;if(t=y.createCallback(t,r,3),typeof u=="number")for(var o=vr(u);++eo&&(o=a)}else t=null==t&&ar(n)?e:y.createCallback(t,r,3),ht(n,function(n,r,e){r=t(n,r,e),r>u&&(u=r,o=n)});return o}function Gt(n,t,r,e){var u=3>arguments.length; +t=y.createCallback(t,e,4);var o=-1,i=n?n.length:0;if(typeof i=="number")for(u&&i&&(r=n[++o]);++oarguments.length;return t=y.createCallback(t,e,4),vt(n,function(n,e,o){r=u?(u=false,n):t(r,n,e,o)}),r}function Jt(n){var t=-1,r=n?n.length:0,e=vr(typeof r=="number"?r:0);return ht(n,function(n){var r=kt(0,++t);e[t]=e[r],e[r]=n}),e}function Qt(n,t,r){var e;t=y.createCallback(t,r,3),r=-1;var u=n?n.length:0; if(typeof u=="number"){for(;++rarguments.length)return Ot(n,w,null,t);if(n)var r=n[N]?n[N][2]:n.length,e=Ft(arguments,2),r=r-e.length;return Ot(n,w|C,r,t,e)}function Zt(n,t,r){function e(){c&&Tr(c),i=c=p=_,(h||g!==t)&&(s=_e(),a=n.apply(l,o),c||i||(o=l=null))}function u(){var r=t-(_e()-f);0>=r||r>t?(i&&Tr(i),r=p,i=c=p=_,r&&(s=_e(),a=n.apply(l,o),c||i||(o=l=null))):c=zr(u,r)}var o,i,a,f,l,c,p,s=0,g=false,h=true; if(!ur(n))throw new xr;if(t=Jr(0,t)||0,true===r)var v=true,h=false;else or(r)&&(v=r.leading,g="maxWait"in r&&(Jr(t,r.maxWait)||0),h="trailing"in r?r.trailing:h);return function(){if(o=arguments,f=_e(),l=this,p=h&&(c||!v),false===g)var r=v&&!c;else{i||v||(s=f);var y=g-(f-s),m=0>=y||y>g;m?(i&&(i=Tr(i)),s=f,a=n.apply(l,o)):i||(i=zr(e,y))}return m&&c?c=Tr(c):c||t===g||(c=zr(u,t)),r&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a}}function nr(n,t,r){var e=arguments,u=0,o=e.length,i=typeof r;if("number"!=i&&"string"!=i||!e[3]||e[3][r]!==t||(o=2),3--n?t.apply(this,arguments):void 0}},y.assign=nr,y.at=function(n,t){var r=arguments,e=-1,u=mt(r,true,false,1),o=u.length,i=typeof t;for("number"!=i&&"string"!=i||!r[2]||r[2][t]!==n||(o=1),r=vr(o);++e--n?t.apply(this,arguments):void 0}},y.assign=nr,y.at=function(n,t){var r=arguments,e=-1,u=mt(r,true,false,1),o=u.length,i=typeof t;for("number"!=i&&"string"!=i||!r[2]||r[2][t]!==n||(o=1),r=vr(o);++earguments.length?Ot(t,w|k,null,n):Ot(t,w|k|C,null,n,Ft(arguments,2))},y.chain=function(n){return n=new m(n),n.__chain__=true,n},y.compact=function(n){for(var t=-1,r=n?n.length:0,e=0,u=[];++t=A&&ae(e?n[e]:f)))}var a=n[0],s=-1,g=a?a.length:0,h=[]; n:for(;++s(v?r(v,l):i(f,l))){for(e=u,(v||f).push(l);--e;)if(v=o[e],0>(v?r(v,l):i(n[e],l)))continue n;h.push(l)}}return p(o),p(f),h},y.invert=function(n,t){for(var r=-1,e=ye(n),u=e.length,o={};++rarguments.length&&typeof u=="number")for(;++rr?Jr(0,e+r):Qr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},y.mixin=sr,y.noConflict=function(){return n._=Er,this},y.noop=gr,y.now=_e,y.parseInt=we,y.random=function(n,t,r){var e=null==n,u=null==t;return null==r&&(u&&typeof n=="boolean"?(r=n,n=1):typeof t=="boolean"&&(r=t,u=true)),e&&u&&(t=1,u=false),n=+n||0,u?(t=n,n=0):t=+t||0,r||n%1||t%1?(r=ne(),Qr(n+r*(t-n+parseFloat("1e-"+((r+"").length-1))),t)):kt(n,t) -},y.reduce=Xt,y.reduceRight=Gt,y.result=function(n,t,r){var e=null==n?_:n[t];return typeof e=="undefined"?r:ur(e)?n[t]():e},y.runInContext=b,y.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:ye(n).length},y.some=Qt,y.sortedIndex=$t,y.template=function(n,t,r){var e=y.templateSettings;n=jr(n||""),r=tr({},r,e);var u,o=tr({},r.imports,e.imports),e=ye(o),o=fr(o),i=0,a=r.interpolate||M,f="__p+='",a=kr((r.escape||M).source+"|"+a.source+"|"+(a===W?z:M).source+"|"+(r.evaluate||M).source+"|$","g"); +},y.reduce=Gt,y.reduceRight=Ht,y.result=function(n,t,r){var e=null==n?_:n[t];return typeof e=="undefined"?r:ur(e)?n[t]():e},y.runInContext=b,y.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:ye(n).length},y.some=Qt,y.sortedIndex=$t,y.template=function(n,t,r){var e=y.templateSettings;n=jr(n||""),r=tr({},r,e);var u,o=tr({},r.imports,e.imports),e=ye(o),o=fr(o),i=0,a=r.interpolate||M,f="__p+='",a=kr((r.escape||M).source+"|"+a.source+"|"+(a===W?z:M).source+"|"+(r.evaluate||M).source+"|$","g"); n.replace(a,function(t,r,e,o,a,c){return e||(e=o),f+=n.slice(i,c).replace(V,l),r&&(f+="'+__e("+r+")+'"),a&&(u=true,f+="';"+a+";\n__p+='"),e&&(f+="'+((__t=("+e+"))==null?'':__t)+'"),i=c+t.length,t}),f+="';",a=r=r.variable,a||(r="obj",f="with("+r+"){"+f+"}"),f=(u?f.replace(I,""):f).replace(T,"$1").replace(F,"$1;"),f="function("+r+"){"+(a?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=dr(e,"return "+f).apply(_,o) -}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},y.trim=me,y.trimLeft=de,y.trimRight=be,y.unescape=function(n){return null==n?"":(n=jr(n),0>n.indexOf(";")?n:n.replace($,d))},y.uniqueId=function(n){var t=++R;return jr(null==n?"":n)+t},y.all=Lt,y.any=Qt,y.detect=Kt,y.findWhere=Kt,y.foldl=Xt,y.foldr=Gt,y.include=zt,y.inject=Xt,sr(function(){var n={};return dt(y,function(t,r){y.prototype[r]||(n[r]=t)}),n}(),false),y.first=Rt,y.last=function(n,t,r){var e=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u; +}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},y.trim=me,y.trimLeft=de,y.trimRight=be,y.unescape=function(n){return null==n?"":(n=jr(n),0>n.indexOf(";")?n:n.replace($,d))},y.uniqueId=function(n){var t=++R;return jr(null==n?"":n)+t},y.all=Lt,y.any=Qt,y.detect=Kt,y.findWhere=Kt,y.foldl=Gt,y.foldr=Ht,y.include=zt,y.inject=Gt,sr(function(){var n={};return dt(y,function(t,r){y.prototype[r]||(n[r]=t)}),n}(),false),y.first=Rt,y.last=function(n,t,r){var e=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u; for(t=y.createCallback(t,r,3);o--&&t(n[o],o,n);)e++}else if(e=t,null==e||r)return n?n[u-1]:_;return e=u-e,Ft(n,0"']/g,D=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,L=/\w*$/,P=/^\s*function[ \n\r\t]+\w/,K=/^0[xX]/,M=/($^)/,U=/\bthis\b/,V=/['\n\r\t\u2028\u2029\\]/g,H=" \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=[],G=[],J="Array Boolean Date Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),Q="[object Arguments]",Y="[object Array]",Z="[object Boolean]",nt="[object Date]",tt="[object Function]",rt="[object Number]",et="[object Object]",ut="[object RegExp]",ot="[object String]",it={}; +}}),y}var _,w=1,k=2,j=4,x=8,C=16,O=32,A=40,S=40,E="2.4.1",N="__lodash@"+E+"__",R=0,I=/\b__p\+='';/g,T=/\b(__p\+=)''\+/g,F=/(__e\(.*?\)|\b__t\))\+'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,B=/[&<>"']/g,D=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,z=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,L=/\w*$/,P=/^\s*function[ \n\r\t]+\w/,K=/^0[xX]/,M=/($^)/,U=/\bthis\b/,V=/['\n\r\t\u2028\u2029\\]/g,X=" \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",G=[],H=[],J="Array Boolean Date Function Math Number Object RegExp Set String _ clearTimeout document isFinite isNaN parseInt setTimeout TypeError window WinRTError".split(" "),Q="[object Arguments]",Y="[object Array]",Z="[object Boolean]",nt="[object Date]",tt="[object Function]",rt="[object Number]",et="[object Object]",ut="[object RegExp]",ot="[object String]",it={}; it[tt]=false,it[Q]=it[Y]=it[Z]=it[nt]=it[rt]=it[et]=it[ut]=it[ot]=true;var at={leading:false,maxWait:0,trailing:false},ft={configurable:false,enumerable:false,value:null,writable:false},lt={"&":"&","<":"<",">":">",'"':""","'":"'"},ct={"&":"&","<":"<",">":">",""":'"',"'":"'"},pt={"function":true,object:true},st={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},gt=pt[typeof window]&&window||this,ht=pt[typeof exports]&&exports&&!exports.nodeType&&exports,pt=pt[typeof module]&&module&&!module.nodeType&&module,vt=ht&&pt&&typeof global=="object"&&global; !vt||vt.global!==vt&&vt.window!==vt&&vt.self!==vt||(gt=vt);var vt=pt&&pt.exports===ht&&ht,yt=b();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(gt._=yt, define(function(){return yt})):ht&&pt?vt?(pt.exports=yt)._=yt:ht._=yt:gt._=yt}).call(this); \ No newline at end of file diff --git a/dist/lodash.underscore.js b/dist/lodash.underscore.js index 0611fe1ee..0c42cbe59 100644 --- a/dist/lodash.underscore.js +++ b/dist/lodash.underscore.js @@ -430,10 +430,16 @@ // `Function#bind` spec // http://es5.github.io/#x15.3.4.5 if (partialArgs) { - // avoid `arguments` object deoptimizations by using `slice` instead - // of `Array.prototype.slice.call` and not assigning `arguments` to a - // variable as a ternary expression - var args = composeArgs(partialArgs, partialHolders, arguments); + // avoid `arguments` object use disqualifying optimizations by + // converting it to an array before passing it to `composeArgs` + var index = -1, + length = arguments.length, + args = Array(length); + + while (++index < length) { + args[index] = arguments[index]; + } + args = composeArgs(partialArgs, partialHolders, args); } // mimic the constructor's `return` behavior // http://es5.github.io/#x13.2.2 @@ -534,27 +540,29 @@ key = func; function bound() { - var thisBinding = isBind ? thisArg : this; + var index = -1, + length = arguments.length, + args = Array(length); + + while (++index < length) { + args[index] = arguments[index]; + } if (partialArgs) { - var args = composeArgs(partialArgs, partialHolders, arguments); + args = composeArgs(partialArgs, partialHolders, args); } if (partialRightArgs) { - args = composeArgsRight(partialRightArgs, partialRightHolders, args || arguments); + args = composeArgsRight(partialRightArgs, partialRightHolders, args); } - if (isCurry) { - var argsLength = arguments.length; - if (argsLength < arity) { - args || (args = slice(arguments)); - bitmask |= PARTIAL_FLAG; - bitmask &= ~PARTIAL_RIGHT_FLAG - if (!isCurryBound) { - bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); - } - var newArity = nativeMax(0, arity - argsLength); - return baseCreateWrapper([func, bitmask, newArity, thisArg, args, null, []]); + if (isCurry && length < arity) { + bitmask |= PARTIAL_FLAG; + bitmask &= ~PARTIAL_RIGHT_FLAG + if (!isCurryBound) { + bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); } + var newArity = nativeMax(0, arity - length); + return baseCreateWrapper([func, bitmask, newArity, thisArg, args, null, []]); } - args || (args = arguments); + var thisBinding = isBind ? thisArg : this; if (isBindKey) { func = thisBinding[key]; } @@ -911,21 +919,21 @@ * @returns {Array} Returns a new array of composed arguments. */ function composeArgs(partialArgs, partialHolders, args) { - var index = -1, - length = partialHolders.length, + var holdersLength = partialHolders.length, + argsIndex = -1, + argsLength = nativeMax(args.length - holdersLength, 0), leftIndex = -1, leftLength = partialArgs.length, - argsLength = nativeMax(args.length - length, 0), result = Array(argsLength + leftLength); while (++leftIndex < leftLength) { result[leftIndex] = partialArgs[leftIndex]; } - while (++index < length) { - result[partialHolders[index]] = args[index]; + while (++argsIndex < holdersLength) { + result[partialHolders[argsIndex]] = args[argsIndex]; } - while (length < argsLength) { - result[leftIndex++] = args[length++]; + while (argsLength--) { + result[leftIndex++] = args[argsIndex++]; } return result; } @@ -941,10 +949,10 @@ * @returns {Array} Returns a new array of composed arguments. */ function composeArgsRight(partialRightArgs, partialRightHolders, args) { - var index = -1, - length = partialRightHolders.length, + var holdersIndex = -1, + holdersLength = partialRightHolders.length, argsIndex = -1, - argsLength = nativeMax(args.length - length, 0), + argsLength = nativeMax(args.length - holdersLength, 0), rightIndex = -1, rightLength = partialRightArgs.length, result = Array(argsLength + rightLength); @@ -956,8 +964,8 @@ while (++rightIndex < rightLength) { result[pad + rightIndex] = partialRightArgs[rightIndex]; } - while (++index < length) { - result[pad + partialHolders[index]] = args[argsIndex++]; + while (++holdersIndex < holdersLength) { + result[pad + partialRightHolders[holdersIndex]] = args[argsIndex++]; } return result; } @@ -4568,7 +4576,7 @@ /** * Creates a compiled template function that can interpolate data properties - * in "interpolate" delimiters, HTML escape interpolated data properties in + * in "interpolate" delimiters, HTML-escaped interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. If * a data object is provided the interpolated template string will be returned. * Data properties may be accessed as free variables in the template. If a @@ -4597,8 +4605,8 @@ * @param {RegExp} [options.interpolate] The "interpolate" delimiter. * @param {string} [options.sourceURL] The sourceURL of the template's compiled source. * @param {string} [options.variable] The data object variable name. - * @returns {Function|string} Returns the interpolated text if a data object - * if a data object is given, else it returns a template function. + * @returns {Function|string} Returns the interpolated string if a data object + * is provided, else it returns a template function. * @example * * // using the "interpolate" delimiter to create a compiled template diff --git a/dist/lodash.underscore.min.js b/dist/lodash.underscore.min.js index 7b90ffa56..5926afd9c 100644 --- a/dist/lodash.underscore.min.js +++ b/dist/lodash.underscore.min.js @@ -3,40 +3,40 @@ * Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.6.0 underscorejs.org/LICENSE * Build: `lodash underscore -o ./dist/lodash.underscore.js` */ -;(function(){function n(n){var r=[];if(!L(n))return r;for(var t in n)Pr.call(n,t)&&r.push(t);return r}function r(n,r){if(L(n))for(var t in n)if(r(n[t],t,n)===sr)break}function t(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++te||typeof t=="undefined"){t=1;break n}if(te||typeof t=="undefined"){t=1;break n}if(te(r,i)&&o.push(i)}return o}function h(n,r){var t=-1,e=n?n.length:0;if(typeof e=="number")for(;++tu(f,l))&&(t&&f.push(l),i.push(a))}return i}function _(n,r,t){for(var e=-1,u=r.length,o=-1,i=n.length,f=Yr(t.length-u,0),a=Array(f+i);++ot&&(t=0),c&&(i=j(u)),p&&(f=j(o)),n=[n,r,t,e,u,o,i,f],r==or||r==(or|lr)?l(n):s(n) -}function j(n){for(var r=-1,t=n.length,e=[];++ru(f,l))&&(t&&f.push(l),i.push(a))}return i}function _(n,r,t){for(var e=r.length,u=-1,o=Yr(t.length-e,0),i=-1,f=n.length,a=Array(o+f);++it&&(t=0),c&&(i=j(u)),p&&(f=j(o)),n=[n,r,t,e,u,o,i,f],r==or||r==(or|lr)?l(n):s(n) +}function j(n){for(var r=-1,t=n.length,e=[];++re?Yr(0,u+e):e||0;else if(e)return e=N(n,r),u&&n[e]===r?e:-1;return t(n,r,e)}function k(n,r,t){if(typeof r!="number"&&null!=r){var e=0,u=-1,o=n?n.length:0;for(r=Z(r,t,3);++ur?r=Yr(u+r,0):r>u&&(r=u),typeof t=="undefined"?t=u:0>t?t=Yr(u+t,0):t>u&&(t=u),u=t-r||0,t=Array(u);++e>>1,t(n[e])u&&(u=t);else r=Z(r,t,3),h(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function W(n,r,t,e){var u=3>arguments.length;r=Z(r,e,4);var o=-1,i=n?n.length:0; -if(typeof i=="number")for(u&&i&&(t=n[++o]);++oarguments.length;return r=Z(r,e,4),v(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 h(n,function(n){var t;t=++r,t=0+Cr(rt()*(t-0+1)),e[r]=e[t],e[t]=n}),e}function H(n,r,t){var e;r=Z(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number"){for(;++targuments.length)return w(n,or,null,r);if(n)var t=n[pr]?n[pr][2]:n.length,e=S(arguments,2),t=t-e.length;return w(n,or|lr,t,r,e)}function U(n,r,t){function e(){c&&clearTimeout(c),i=c=p=ur,(h||g!==r)&&(s=pt(),f=n.apply(l,o),c||i||(o=l=null))}function u(){var t=r-(pt()-a);0>=t||t>r?(i&&clearTimeout(i),t=p,i=c=p=ur,t&&(s=pt(),f=n.apply(l,o),c||i||(o=l=null))):c=setTimeout(u,t)}var o,i,f,a,l,c,p,s=0,g=false,h=true;if(!K(n))throw new TypeError; -if(r=Yr(0,r)||0,true===t)var v=true,h=false;else L(t)&&(v=t.leading,g="maxWait"in t&&(Yr(r,t.maxWait)||0),h="trailing"in t?t.trailing:h);return function(){if(o=arguments,a=pt(),l=this,p=h&&(c||!v),false===g)var t=v&&!c;else{i||v||(s=a);var y=g-(a-s),m=0>=y||y>g;m?(i&&(i=clearTimeout(i)),s=a,f=n.apply(l,o)):i||(i=setTimeout(e,y))}return m&&c?c=clearTimeout(c):c||r===g||(c=setTimeout(u,r)),t&&(m=true,f=n.apply(l,o)),!m||c||i||(o=l=null),f}}function V(n,r,t){if(!n)return n;var e=arguments,u=0,o=e.length,i=typeof t; -for("number"!=i&&"string"!=i||!e[3]||e[3][t]!==r||(o=2);++u"']/g,yr=/($^)/,mr=/['\n\r\t\u2028\u2029\\]/g,br="[object Arguments]",_r="[object Array]",dr="[object Boolean]",wr="[object Date]",jr="[object Number]",xr="[object Object]",Ar="[object RegExp]",Tr="[object String]",Er={"&":"&","<":"<",">":">",'"':""","'":"'"},Or={"&":"&","<":"<",">":">",""":'"',"'":"'"},kr={"function":true,object:true},Sr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Nr=kr[typeof window]&&window||this,qr=kr[typeof exports]&&exports&&!exports.nodeType&&exports,Fr=kr[typeof module]&&module&&!module.nodeType&&module,Br=qr&&Fr&&typeof global=="object"&&global; -!Br||Br.global!==Br&&Br.window!==Br&&Br.self!==Br||(Nr=Br);var Rr=Fr&&Fr.exports===qr&&qr,$r=Array.prototype,Ir=Object.prototype,Mr=Nr._,Dr=Ir.toString,Wr=RegExp("^"+(Dr+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zr=Math.ceil,Cr=Math.floor,Hr=Function.prototype.toString,Pr=Ir.hasOwnProperty,Ur=$r.push,Vr=Ir.propertyIsEnumerable,Gr=$r.splice,Jr=A(Jr=Object.create)&&Jr,Kr=A(Kr=Array.isArray)&&Kr,Lr=Nr.isFinite,Qr=Nr.isNaN,Xr=A(Xr=Object.keys)&&Xr,Yr=Math.max,Zr=Math.min,nt=A(nt=Date.now)&&nt,rt=Math.random; -a.prototype=f.prototype;var tt={};!function(){var n={0:1,length:1};tt.spliceObjects=(Gr.call(n,0,1),!n[0])}(1),f.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Jr||(c=function(){function n(){}return function(r){if(L(r)){n.prototype=r;var t=new n;n.prototype=null}return t||Nr.Object()}}()),T(arguments)||(T=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Pr.call(n,"callee")&&!Vr.call(n,"callee")||false});var et=d(function(n,r,t){Pr.call(n,t)?n[t]++:n[t]=1 -}),ut=d(function(n,r,t){Pr.call(n,t)?n[t].push(r):n[t]=[r]}),ot=d(function(n,r,t){n[t]=r}),it=d(function(n,r,t){n[t?0:1].push(r)},true),ft=M,at=R,lt=Kr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Dr.call(n)==_r||false};K(/x/)&&(K=function(n){return typeof n=="function"&&"[object Function]"==Dr.call(n)});var ct=Xr?function(n){return L(n)?Xr(n):[]}:n,pt=nt||function(){return(new Date).getTime()};f.after=function(n,r){if(!K(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0 -}},f.bind=P,f.bindAll=function(n){for(var r=1arguments.length;return r=Z(r,e,4),v(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 h(n,function(n){var t;t=++r,t=0+Cr(rt()*(t-0+1)),e[r]=e[t],e[t]=n}),e}function P(n,r,t){var e;r=Z(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number"){for(;++targuments.length)return w(n,or,null,r);if(n)var t=n[pr]?n[pr][2]:n.length,e=S(arguments,2),t=t-e.length;return w(n,or|lr,t,r,e)}function V(n,r,t){function e(){c&&clearTimeout(c),i=c=p=ur,(h||g!==r)&&(s=pt(),f=n.apply(l,o),c||i||(o=l=null))}function u(){var t=r-(pt()-a);0>=t||t>r?(i&&clearTimeout(i),t=p,i=c=p=ur,t&&(s=pt(),f=n.apply(l,o),c||i||(o=l=null))):c=setTimeout(u,t)}var o,i,f,a,l,c,p,s=0,g=false,h=true;if(!K(n))throw new TypeError; +if(r=Yr(0,r)||0,true===t)var v=true,h=false;else L(t)&&(v=t.leading,g="maxWait"in t&&(Yr(r,t.maxWait)||0),h="trailing"in t?t.trailing:h);return function(){if(o=arguments,a=pt(),l=this,p=h&&(c||!v),false===g)var t=v&&!c;else{i||v||(s=a);var y=g-(a-s),m=0>=y||y>g;m?(i&&(i=clearTimeout(i)),s=a,f=n.apply(l,o)):i||(i=setTimeout(e,y))}return m&&c?c=clearTimeout(c):c||r===g||(c=setTimeout(u,r)),t&&(m=true,f=n.apply(l,o)),!m||c||i||(o=l=null),f}}function G(n,r,t){if(!n)return n;var e=arguments,u=0,o=e.length,i=typeof t; +for("number"!=i&&"string"!=i||!e[3]||e[3][t]!==r||(o=2);++u"']/g,yr=/($^)/,mr=/['\n\r\t\u2028\u2029\\]/g,br="[object Arguments]",_r="[object Array]",dr="[object Boolean]",wr="[object Date]",jr="[object Number]",xr="[object Object]",Ar="[object RegExp]",Tr="[object String]",Er={"&":"&","<":"<",">":">",'"':""","'":"'"},Or={"&":"&","<":"<",">":">",""":'"',"'":"'"},kr={"function":true,object:true},Sr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Nr=kr[typeof window]&&window||this,qr=kr[typeof exports]&&exports&&!exports.nodeType&&exports,Fr=kr[typeof module]&&module&&!module.nodeType&&module,Br=qr&&Fr&&typeof global=="object"&&global; +!Br||Br.global!==Br&&Br.window!==Br&&Br.self!==Br||(Nr=Br);var Rr=Fr&&Fr.exports===qr&&qr,$r=Array.prototype,Ir=Object.prototype,Mr=Nr._,Dr=Ir.toString,Wr=RegExp("^"+(Dr+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zr=Math.ceil,Cr=Math.floor,Pr=Function.prototype.toString,Ur=Ir.hasOwnProperty,Vr=$r.push,Gr=Ir.propertyIsEnumerable,Hr=$r.splice,Jr=A(Jr=Object.create)&&Jr,Kr=A(Kr=Array.isArray)&&Kr,Lr=Nr.isFinite,Qr=Nr.isNaN,Xr=A(Xr=Object.keys)&&Xr,Yr=Math.max,Zr=Math.min,nt=A(nt=Date.now)&&nt,rt=Math.random; +a.prototype=f.prototype;var tt={};!function(){var n={0:1,length:1};tt.spliceObjects=(Hr.call(n,0,1),!n[0])}(1),f.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Jr||(c=function(){function n(){}return function(r){if(L(r)){n.prototype=r;var t=new n;n.prototype=null}return t||Nr.Object()}}()),T(arguments)||(T=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ur.call(n,"callee")&&!Gr.call(n,"callee")||false});var et=d(function(n,r,t){Ur.call(n,t)?n[t]++:n[t]=1 +}),ut=d(function(n,r,t){Ur.call(n,t)?n[t].push(r):n[t]=[r]}),ot=d(function(n,r,t){n[t]=r}),it=d(function(n,r,t){n[t?0:1].push(r)},true),ft=M,at=R,lt=Kr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Dr.call(n)==_r||false};K(/x/)&&(K=function(n){return typeof n=="function"&&"[object Function]"==Dr.call(n)});var ct=Xr?function(n){return L(n)?Xr(n):[]}:n,pt=nt||function(){return(new Date).getTime()};f.after=function(n,r){if(!K(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0 +}},f.bind=U,f.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},f.invert=function(n){for(var r=-1,t=ct(n),e=t.length,u={};++rarguments.length&&typeof u=="number")for(;++targuments.length&&typeof u=="number")for(;++tr?0:r);++nt?Yr(0,e+t):Zr(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},f.mixin=tr,f.noConflict=function(){return Nr._=Mr,this},f.now=pt,f.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Cr(rt()*(r-n+1))},f.reduce=W,f.reduceRight=z,f.result=function(n,r){if(null!=n){var t=n[r];return K(t)?n[r]():t}},f.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:ct(n).length},f.some=H,f.sortedIndex=N,f.template=function(n,r,t){var e=f,u=e.templateSettings; -n=(n||"")+"",t=G({},t,u);var i=0,a="__p+='",u=t.variable;n.replace(RegExp((t.escape||yr).source+"|"+(t.interpolate||yr).source+"|"+(t.evaluate||yr).source+"|$","g"),function(r,t,e,u,f){return a+=n.slice(i,f).replace(mr,o),t&&(a+="'+_.escape("+t+")+'"),u&&(a+="';"+u+";\n__p+='"),e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),i=f+r.length,r}),a+="';",u||(u="obj",a="with("+u+"||{}){"+a+"}"),a="function("+u+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}"; -try{var l=Function("_","return "+a)(e)}catch(c){throw c.source=a,c}return r?l(r):(l.source=a,l)},f.unescape=function(n){return null==n?"":(n+="",0>n.indexOf(";")?n:n.replace(hr,i))},f.uniqueId=function(n){var r=++gr+"";return n?n+r:r},f.all=B,f.any=H,f.detect=$,f.findWhere=$,f.foldl=W,f.foldr=z,f.include=F,f.inject=W,f.first=E,f.last=function(n,r,t){var e=0,u=n?n.length:0;if(typeof r!="number"&&null!=r){var o=u;for(r=Z(r,t,3);o--&&r(n[o],o,n);)e++}else if(e=r,null==e||t)return n?n[u-1]:ur;return e=u-e,S(n,0r?0:r);++nt?Yr(0,e+t):Zr(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},f.mixin=tr,f.noConflict=function(){return Nr._=Mr,this},f.now=pt,f.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Cr(rt()*(r-n+1))},f.reduce=W,f.reduceRight=z,f.result=function(n,r){if(null!=n){var t=n[r];return K(t)?n[r]():t}},f.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:ct(n).length},f.some=P,f.sortedIndex=N,f.template=function(n,r,t){var e=f,u=e.templateSettings; +n=(n||"")+"",t=H({},t,u);var i=0,a="__p+='",u=t.variable;n.replace(RegExp((t.escape||yr).source+"|"+(t.interpolate||yr).source+"|"+(t.evaluate||yr).source+"|$","g"),function(r,t,e,u,f){return a+=n.slice(i,f).replace(mr,o),t&&(a+="'+_.escape("+t+")+'"),u&&(a+="';"+u+";\n__p+='"),e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),i=f+r.length,r}),a+="';",u||(u="obj",a="with("+u+"||{}){"+a+"}"),a="function("+u+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}"; +try{var l=Function("_","return "+a)(e)}catch(c){throw c.source=a,c}return r?l(r):(l.source=a,l)},f.unescape=function(n){return null==n?"":(n+="",0>n.indexOf(";")?n:n.replace(hr,i))},f.uniqueId=function(n){var r=++gr+"";return n?n+r:r},f.all=B,f.any=P,f.detect=$,f.findWhere=$,f.foldl=W,f.foldr=z,f.include=F,f.inject=W,f.first=E,f.last=function(n,r,t){var e=0,u=n?n.length:0;if(typeof r!="number"&&null!=r){var o=u;for(r=Z(r,t,3);o--&&r(n[o],o,n);)e++}else if(e=r,null==e||t)return n?n[u-1]:ur;return e=u-e,S(n,0 ### `_.compact(array)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2224 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2232 "View in source") [Ⓣ][1] Creates an array with all falsey values removed. The values `false`, `null`, `0`, `""`, `undefined`, and `NaN` are all falsey. @@ -278,7 +278,7 @@ _.compact([0, 1, false, 2, '', 3]); ### `_.difference(array, [values])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2254 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2262 "View in source") [Ⓣ][1] Creates an array excluding all values of the provided arrays using strict equality for comparisons, i.e. `===`. @@ -303,7 +303,7 @@ _.difference([1, 2, 3], [5, 2, 10]); ### `_.findIndex(array, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2299 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2307 "View in source") [Ⓣ][1] This method is like `_.find` except that it returns the index of the first element that passes the callback check, instead of the element itself. @@ -349,7 +349,7 @@ _.findIndex(characters, 'blocked'); ### `_.findLastIndex(array, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2353 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2361 "View in source") [Ⓣ][1] This method is like `_.findIndex` except that it iterates over elements of a `collection` from right to left. @@ -395,7 +395,7 @@ _.findLastIndex(characters, 'blocked'); ### `_.first(array, [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2418 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2426 "View in source") [Ⓣ][1] Gets the first element or first `n` elements of an array. If a callback is provided elements at the beginning of the array are returned as long as the callback returns truey. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -452,7 +452,7 @@ _.pluck(_.first(characters, { 'employer': 'slate' }), 'name'); ### `_.flatten(array, [isShallow=false], [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2479 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2487 "View in source") [Ⓣ][1] Flattens a nested array *(the nesting can be to any depth)*. If `isShallow` is truey, the array will only be flattened a single level. If a callback is provided each element of the array is passed through the callback before flattening. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -496,7 +496,7 @@ _.flatten(characters, 'pets'); ### `_.indexOf(array, value, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2525 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2533 "View in source") [Ⓣ][1] Gets the index at which the first occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If the array is already sorted providing `true` for `fromIndex` will run a faster binary search. @@ -530,7 +530,7 @@ _.indexOf([1, 1, 2, 2, 3, 3], 2, true); ### `_.initial(array, [callback=1], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2588 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2596 "View in source") [Ⓣ][1] Gets all but the last element or last `n` elements of an array. If a callback is provided elements at the end of the array are excluded from the result as long as the callback returns truey. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -584,7 +584,7 @@ _.pluck(_.initial(characters, { 'employer': 'na' }), 'name'); ### `_.intersection([array])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2619 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2627 "View in source") [Ⓣ][1] Creates an array of unique values present in all provided arrays using strict equality for comparisons, i.e. `===`. @@ -608,7 +608,7 @@ _.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]); ### `_.last(array, [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2715 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2723 "View in source") [Ⓣ][1] Gets the last element or last `n` elements of an array. If a callback is provided elements at the end of the array are returned as long as the callback returns truey. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -662,7 +662,7 @@ _.last(characters, { 'employer': 'na' }); ### `_.lastIndexOf(array, value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2763 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2771 "View in source") [Ⓣ][1] Gets the index at which the last occurrence of `value` is found using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection. @@ -696,7 +696,7 @@ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2, 3); ### `_.pull(array, [value])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2793 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2801 "View in source") [Ⓣ][1] Removes all provided values from `array` using strict equality for comparisons, i.e. `===`. @@ -723,7 +723,7 @@ console.log(array); ### `_.range([start=0], end, [step=1])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2845 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2852 "View in source") [Ⓣ][1] Creates an array of numbers *(positive and/or negative)* progressing from `start` up to but not including `end`. If `start` is less than `stop` a zero-length range is created unless a negative `step` is specified. @@ -764,7 +764,7 @@ _.range(0); ### `_.remove(array, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2898 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2905 "View in source") [Ⓣ][1] Removes all elements from an array that the callback returns truey for and returns an array of removed elements. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -800,7 +800,7 @@ console.log(evens); ### `_.rest(array, [callback=1], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2969 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2976 "View in source") [Ⓣ][1] The opposite of `_.initial`; this method gets all but the first element or first `n` elements of an array. If a callback function is provided elements at the beginning of the array are excluded from the result as long as the callback returns truey. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -857,7 +857,7 @@ _.rest(characters, { 'employer': 'slate' }); ### `_.slice(array, [start=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3001 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3008 "View in source") [Ⓣ][1] Slices `array` from the `start` index up to, but not including, the `end` index. @@ -879,7 +879,7 @@ Note: This function is used instead of `Array#slice` to support node lists in IE ### `_.sortedIndex(array, value, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3078 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3085 "View in source") [Ⓣ][1] Uses a binary search to determine the smallest index at which a value should be inserted into a given sorted array in order to maintain the sort order of the array. If a callback is provided it will be executed for `value` and each element of `array` to compute their sort ranking. The callback is bound to `thisArg` and invoked with one argument; *(value)*. @@ -930,7 +930,7 @@ _.sortedIndex([{ 'x': 20 }, { 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x'); ### `_.union([array])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3109 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3116 "View in source") [Ⓣ][1] Creates an array of unique values, in order, of the provided arrays using strict equality for comparisons, i.e. `===`. @@ -954,7 +954,7 @@ _.union([1, 2, 3], [5, 2, 1, 4], [2, 1]); ### `_.uniq(array, [isSorted=false], [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3160 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3167 "View in source") [Ⓣ][1] Creates a duplicate-value-free version of an array using strict equality for comparisons, i.e. `===`. If the array is sorted, providing `true` for `isSorted` will use a faster algorithm. If a callback is provided each element of `array` is passed through the callback before uniqueness is computed. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, array)*. @@ -1004,7 +1004,7 @@ _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); ### `_.without(array, [value])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3195 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3202 "View in source") [Ⓣ][1] Creates an array excluding all provided values using strict equality for comparisons, i.e. `===`. @@ -1029,7 +1029,7 @@ _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); ### `_.xor([array])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3216 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3223 "View in source") [Ⓣ][1] Creates an array that is the symmetric difference of the provided arrays. See [Wikipedia](http://en.wikipedia.org/wiki/Symmetric_difference) for more details. @@ -1056,7 +1056,7 @@ _.xor([1, 2, 5], [2, 3, 5], [3, 4, 5]); ### `_.zip([array])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3251 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3258 "View in source") [Ⓣ][1] Creates an array of grouped elements, the first of which contains the first elements of the given arrays, the second of which contains the second elements of the given arrays, and so on. If a zipped value is provided its corresponding unzipped value will be returned. @@ -1086,7 +1086,7 @@ _.unzip([['fred', 30, true], ['barney', 40, false]]); ### `_.zipObject(keys, [values=[]])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3281 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3288 "View in source") [Ⓣ][1] Creates an object composed from arrays of `keys` and `values`. Provide either a single two dimensional array, i.e. `[[key1, value1], [key2, value2]]` or two arrays, one of `keys` and one of corresponding `values`. @@ -1176,7 +1176,7 @@ _.isArray(squares.value()); ### `_.chain(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3326 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3333 "View in source") [Ⓣ][1] Creates a `lodash` object that wraps `value` with explicit method chaining enabled. @@ -1210,7 +1210,7 @@ var youngest = _.chain(characters) ### `_.tap(value, interceptor, [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3353 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3360 "View in source") [Ⓣ][1] This method invokes `interceptor` and returns `value`. The interceptor is bound to `thisArg` and invoked with one argument; *(value)*. The purpose of this method is to "tap into" a method chain in order to perform operations on intermediate results within the chain. @@ -1239,7 +1239,7 @@ _([1, 2, 3, 4]) ### `_.prototype.chain()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3383 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3390 "View in source") [Ⓣ][1] Enables explicit method chaining on the wrapper object. @@ -1273,7 +1273,7 @@ _(characters).chain() ### `_.prototype.toString()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3400 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3407 "View in source") [Ⓣ][1] Produces the `toString` result of the wrapped value. @@ -1294,7 +1294,7 @@ _([1, 2, 3]).toString(); ### `_.prototype.valueOf()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3417 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3424 "View in source") [Ⓣ][1] Extracts the wrapped value. @@ -1325,7 +1325,7 @@ _([1, 2, 3]).valueOf(); ### `_.at(collection, [index])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3445 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3452 "View in source") [Ⓣ][1] Creates an array of elements from the specified indexes, or keys, of the `collection`. Indexes may be specified as individual arguments or as arrays of indexes. @@ -1353,7 +1353,7 @@ _.at(['fred', 'barney', 'pebbles'], 0, 2); ### `_.contains(collection, target, [fromIndex=0])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3493 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3500 "View in source") [Ⓣ][1] Checks if a given value is present in a collection using strict equality for comparisons, i.e. `===`. If `fromIndex` is negative, it is used as the offset from the end of the collection. @@ -1391,7 +1391,7 @@ _.contains('pebbles', 'eb'); ### `_.countBy(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3556 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3563 "View in source") [Ⓣ][1] Creates an object composed of keys generated from the results of running each element of `collection` through the callback. The corresponding value of each key is the number of times the key was returned by the callback. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1427,7 +1427,7 @@ _.countBy(['one', 'two', 'three'], 'length'); ### `_.every(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3601 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3608 "View in source") [Ⓣ][1] Checks if the callback returns truey value for **all** elements of a collection. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1473,7 +1473,7 @@ _.every(characters, { 'age': 36 }); ### `_.filter(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3662 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3669 "View in source") [Ⓣ][1] Iterates over elements of a collection, returning an array of all elements the callback returns truey for. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1519,7 +1519,7 @@ _.filter(characters, { 'age': 36 }); ### `_.find(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3729 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3736 "View in source") [Ⓣ][1] Iterates over elements of a collection, returning the first element that the callback returns truey for. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1568,7 +1568,7 @@ _.find(characters, 'blocked'); ### `_.findLast(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3773 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3780 "View in source") [Ⓣ][1] This method is like `_.find` except that it iterates over elements of a `collection` from right to left. @@ -1596,7 +1596,7 @@ _.findLast([1, 2, 3, 4], function(num) { ### `_.forEach(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3812 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3819 "View in source") [Ⓣ][1] Iterates over elements of a collection, executing the callback for each element. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. Callbacks may exit iteration early by explicitly returning `false`. @@ -1630,7 +1630,7 @@ _.forEach({ 'one': 1, 'two': 2, 'three': 3 }, function(num) { console.log(num); ### `_.forEachRight(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3845 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3852 "View in source") [Ⓣ][1] This method is like `_.forEach` except that it iterates over elements of a `collection` from right to left. @@ -1659,7 +1659,7 @@ _([1, 2, 3]).forEachRight(function(num) { console.log(num); }).join(','); ### `_.groupBy(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3894 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3901 "View in source") [Ⓣ][1] Creates an object composed of keys generated from the results of running each element of a collection through the callback. The corresponding value of each key is an array of the elements responsible for generating the key. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1696,7 +1696,7 @@ _.groupBy(['one', 'two', 'three'], 'length'); ### `_.indexBy(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3941 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3948 "View in source") [Ⓣ][1] Creates an object composed of keys generated from the results of running each element of the collection through the given callback. The corresponding value of each key is the last element responsible for generating the key. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1737,7 +1737,7 @@ _.indexBy(characters, function(key) { this.fromCharCode(key.code); }, String); ### `_.invoke(collection, methodName, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3967 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L3974 "View in source") [Ⓣ][1] Invokes the method named by `methodName` on each element in the `collection` returning an array of the results of each invoked method. Additional arguments will be provided to each invoked method. If `methodName` is a function it will be invoked for, and `this` bound to, each element in the `collection`. @@ -1766,7 +1766,7 @@ _.invoke([123, 456], String.prototype.split, ''); ### `_.map(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4026 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4033 "View in source") [Ⓣ][1] Creates an array of values by running each element in the collection through the callback. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1811,7 +1811,7 @@ _.map(characters, 'name'); ### `_.max(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4084 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4091 "View in source") [Ⓣ][1] Retrieves the maximum value of a collection. If the collection is empty or falsey `-Infinity` is returned. If a callback is provided it will be executed for each value in the collection to generate the criterion by which the value is ranked. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*. @@ -1853,7 +1853,7 @@ _.max(characters, 'age'); ### `_.min(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4159 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4166 "View in source") [Ⓣ][1] Retrieves the minimum value of a collection. If the collection is empty or falsey `Infinity` is returned. If a callback is provided it will be executed for each value in the collection to generate the criterion by which the value is ranked. The callback is bound to `thisArg` and invoked with three arguments; *(value, index, collection)*. @@ -1895,7 +1895,7 @@ _.min(characters, 'age'); ### `_.partition(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4238 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4245 "View in source") [Ⓣ][1] Creates an array of elements split into two groups, the first of which contains elements the callback returns truey for, while the second of which contains elements the callback returns falsey for. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -1942,7 +1942,7 @@ _.map(_.partition(characters, 'blocked'), function(array) { return _.pluck(array ### `_.pluck(collection, key)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4262 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4269 "View in source") [Ⓣ][1] Retrieves the value of a specified property from all elements in the collection. @@ -1972,7 +1972,7 @@ _.pluck(characters, 'name'); ### `_.reduce(collection, [callback=identity], [accumulator], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4294 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4301 "View in source") [Ⓣ][1] Reduces a collection to a value which is the accumulated result of running each element in the collection through the callback, where each successive callback execution consumes the return value of the previous execution. If `accumulator` is not provided the first element of the collection will be used as the initial `accumulator` value. The callback is bound to `thisArg` and invoked with four arguments; *(accumulator, value, index|key, collection)*. @@ -2010,7 +2010,7 @@ var mapped = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) { ### `_.reduceRight(collection, [callback=identity], [accumulator], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4337 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4344 "View in source") [Ⓣ][1] This method is like `_.reduce` except that it iterates over elements of a `collection` from right to left. @@ -2041,7 +2041,7 @@ var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []); ### `_.reject(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4387 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4394 "View in source") [Ⓣ][1] The opposite of `_.filter`; this method returns the elements of a collection that the callback does **not** return truey for. @@ -2084,7 +2084,7 @@ _.reject(characters, { 'age': 36 }); ### `_.sample(collection, [n])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4412 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4419 "View in source") [Ⓣ][1] Retrieves a random element or `n` random elements from a collection. @@ -2112,7 +2112,7 @@ _.sample([1, 2, 3, 4], 2); ### `_.shuffle(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4440 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4447 "View in source") [Ⓣ][1] Creates an array of shuffled values, using a version of the Fisher-Yates shuffle. See [Wikipedia](http://en.wikipedia.org/wiki/Fisher-Yates_shuffle) for more details. @@ -2136,7 +2136,7 @@ _.shuffle([1, 2, 3, 4]); ### `_.size(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4474 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4481 "View in source") [Ⓣ][1] Gets the size of the `collection` by returning `collection.length` for arrays and array-like objects or the number of own enumerable properties for objects. @@ -2166,7 +2166,7 @@ _.size('pebbles'); ### `_.some(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4521 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4528 "View in source") [Ⓣ][1] Checks if the callback returns a truey value for **any** element of a collection. The function returns as soon as it finds a passing value and does not iterate over the entire collection. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -2212,7 +2212,7 @@ _.some(characters, { 'age': 1 }); ### `_.sortBy(collection, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4591 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4598 "View in source") [Ⓣ][1] Creates an array of elements, sorted in ascending order by the results of running each element in a collection through the callback. This method performs a stable sort, that is, it will preserve the original sort order of equal elements. The callback is bound to `thisArg` and invoked with three arguments; *(value, index|key, collection)*. @@ -2262,7 +2262,7 @@ _.map(_.sortBy(characters, ['name', 'age']), _.values); ### `_.toArray(collection)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4640 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4647 "View in source") [Ⓣ][1] Converts the `collection` to an array. @@ -2286,7 +2286,7 @@ Converts the `collection` to an array. ### `_.where(collection, source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4674 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4681 "View in source") [Ⓣ][1] Performs a deep comparison between each element in `collection` and the `source` object, returning an array of all elements that have equivalent property values. @@ -2326,7 +2326,7 @@ _.where(characters, { 'pets': ['dino'] }); ### `_.after(n, func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4702 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4709 "View in source") [Ⓣ][1] Creates a function that executes `func`, with the `this` binding and arguments of the created function, only after being called `n` times. @@ -2359,7 +2359,7 @@ _.forEach(saves, function(type) { ### `_.bind(func, [thisArg], [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4738 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4745 "View in source") [Ⓣ][1] Creates a function that, when called, invokes `func` with the `this` binding of `thisArg` and prepends any additional `bind` arguments to those provided to the bound function. @@ -2392,7 +2392,7 @@ func(); ### `_.bindAll(object, [methodName])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4777 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4784 "View in source") [Ⓣ][1] Binds methods of an object to the object itself, overwriting the existing method. Method names may be specified as individual arguments or as arrays of method names. If no method names are provided all the function properties of `object` will be bound. @@ -2425,7 +2425,7 @@ jQuery('#docs').on('click', view.onClick); ### `_.bindKey(object, key, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4824 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4831 "View in source") [Ⓣ][1] Creates a function that, when called, invokes the method at `object[key]` and prepends any additional `bindKey` arguments to those provided to the bound function. This method differs from `_.bind` by allowing bound functions to reference methods that will be redefined or don't yet exist. See [Peter Michaux's article](http://michaux.ca/articles/lazy-function-definition-pattern) for more details. @@ -2466,7 +2466,7 @@ func(); ### `_.compose([func])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4860 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4867 "View in source") [Ⓣ][1] Creates a function that is the composition of the provided functions, where each function consumes the return value of the function that follows. For example, composing the functions `f()`, `g()`, and `h()` produces `f(g(h()))`. Each function is executed with the `this` binding of the composed function. @@ -2504,7 +2504,7 @@ welcome('pebbles'); ### `_.curry(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4911 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4918 "View in source") [Ⓣ][1] Creates a function which accepts one or more arguments of `func` that when invoked either executes `func` returning its result, if all `func` arguments have been provided, or returns a function that accepts one or more of the remaining `func` arguments, and so on. The arity of `func` can be specified if `func.length` is not sufficient. @@ -2541,7 +2541,7 @@ curried(1, 2, 3); ### `_.debounce(func, wait, [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4957 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L4964 "View in source") [Ⓣ][1] Creates a function that will delay the execution of `func` until after `wait` milliseconds have elapsed since the last time it was invoked. Provide an options object to indicate that `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced function will return the result of the last `func` call. @@ -2585,7 +2585,7 @@ source.addEventListener('message', _.debounce(batchLog, 250, { ### `_.defer(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5073 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5080 "View in source") [Ⓣ][1] Defers executing the `func` function until the current call stack has cleared. Additional arguments will be provided to `func` when it is invoked. @@ -2610,7 +2610,7 @@ _.defer(function(text) { console.log(text); }, 'deferred'); ### `_.delay(func, wait, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5097 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5104 "View in source") [Ⓣ][1] Executes the `func` function after `wait` milliseconds. Additional arguments will be provided to `func` when it is invoked. @@ -2636,7 +2636,7 @@ _.delay(function(text) { console.log(text); }, 1000, 'later'); ### `_.memoize(func, [resolver])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5142 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5149 "View in source") [Ⓣ][1] Creates a function that memoizes the result of `func`. If `resolver` is provided it will be used to determine the cache key for storing the result based on the arguments provided to the memoized function. By default, the first argument provided to the memoized function is used as the cache key. The `func` is executed with the `this` binding of the memoized function. The result cache is exposed as the `cache` property on the memoized function. @@ -2679,7 +2679,7 @@ get('pebbles'); ### `_.once(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5175 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5182 "View in source") [Ⓣ][1] Creates a function that is restricted to execute `func` once. Repeat calls to the function will return the value of the first call. The `func` is executed with the `this` binding of the created function. @@ -2705,7 +2705,7 @@ initialize(); ### `_.partial(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5216 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5223 "View in source") [Ⓣ][1] Creates a function that, when called, invokes `func` with any additional `partial` arguments prepended to those provided to the new function. This method is similar to `_.bind` except it does **not** alter the `this` binding. @@ -2734,7 +2734,7 @@ hi('fred'); ### `_.partialRight(func, [args])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5256 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5263 "View in source") [Ⓣ][1] This method is like `_.partial` except that partially applied arguments are appended to those provided to the new function. @@ -2773,7 +2773,7 @@ options.imports ### `_.throttle(func, wait, [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5297 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5304 "View in source") [Ⓣ][1] Creates a function that, when executed, will only call the `func` function at most once per every `wait` milliseconds. Provide an options object to indicate that `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. Subsequent calls to the throttled function will return the result of the last `func` call. @@ -2809,7 +2809,7 @@ jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { ### `_.wrap(value, wrapper)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5338 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5345 "View in source") [Ⓣ][1] Creates a function that provides `value` to the wrapper function as its first argument. Additional arguments provided to the function are appended to those provided to the wrapper function. The wrapper is executed with the `this` binding of the created function. @@ -2845,7 +2845,7 @@ p('fred, barney, & pebbles'); ### `_.assign(object, [source], [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5373 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5380 "View in source") [Ⓣ][1] Assigns own enumerable properties of source object(s) to the destination object. Subsequent sources will overwrite property assignments of previous sources. If a callback is provided it will be executed to produce the assigned values. The callback is bound to `thisArg` and invoked with two arguments; *(objectValue, sourceValue)*. @@ -2882,7 +2882,7 @@ defaults({ 'name': 'barney' }, { 'name': 'fred', 'employer': 'slate' }); ### `_.clone(value, [isDeep=false], [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5451 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5458 "View in source") [Ⓣ][1] Creates a clone of `value`. If `isDeep` is `true` nested objects will also be cloned, otherwise they will be assigned by reference. If a callback is provided it will be executed to produce the cloned values. If the callback returns `undefined` cloning will be handled by the method instead. The callback is bound to `thisArg` and invoked with one argument; *(value)*. @@ -2931,7 +2931,7 @@ clone.childNodes.length; ### `_.cloneDeep(value, [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5510 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5517 "View in source") [Ⓣ][1] Creates a deep clone of `value`. If a callback is provided it will be executed to produce the cloned values. If the callback returns `undefined` cloning will be handled by the method instead. The callback is bound to `thisArg` and invoked with one argument; *(value)*. @@ -2977,7 +2977,7 @@ clone.node == view.node; ### `_.create(prototype, [properties])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5545 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5552 "View in source") [Ⓣ][1] Creates an object that inherits from the given `prototype` object. If a `properties` object is provided its own enumerable properties are assigned to the created object. @@ -3017,7 +3017,7 @@ circle instanceof Shape; ### `_.defaults(object, [source])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5567 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5574 "View in source") [Ⓣ][1] Assigns own enumerable properties of source object(s) to the destination object for all destination properties that resolve to `undefined`. Once a property is set, additional defaults of the same property will be ignored. @@ -3042,7 +3042,7 @@ _.defaults({ 'name': 'barney' }, { 'name': 'fred', 'employer': 'slate' }); ### `_.findKey(object, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5636 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5643 "View in source") [Ⓣ][1] This method is like `_.findIndex` except that it returns the key of the first element that passes the callback check, instead of the element itself. @@ -3088,7 +3088,7 @@ _.findKey(characters, 'blocked'); ### `_.findLastKey(object, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5690 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5697 "View in source") [Ⓣ][1] This method is like `_.findKey` except that it iterates over elements of a `collection` in the opposite order. @@ -3134,7 +3134,7 @@ _.findLastKey(characters, 'blocked'); ### `_.forIn(object, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5734 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5741 "View in source") [Ⓣ][1] Iterates over own and inherited enumerable properties of an object, executing the callback for each property. The callback is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`. @@ -3172,7 +3172,7 @@ _.forIn(new Shape, function(value, key) { ### `_.forInRight(object, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5767 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5774 "View in source") [Ⓣ][1] This method is like `_.forIn` except that it iterates over elements of a `collection` in the opposite order. @@ -3210,7 +3210,7 @@ _.forInRight(new Shape, function(value, key) { ### `_.forOwn(object, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5803 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5810 "View in source") [Ⓣ][1] Iterates over own enumerable properties of an object, executing the callback for each property. The callback is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`. @@ -3238,7 +3238,7 @@ _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { ### `_.forOwnRight(object, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5826 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5833 "View in source") [Ⓣ][1] This method is like `_.forOwn` except that it iterates over elements of a `collection` in the opposite order. @@ -3266,7 +3266,7 @@ _.forOwnRight({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) { ### `_.functions(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5855 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5862 "View in source") [Ⓣ][1] Creates a sorted array of property names of all enumerable properties, own and inherited, of `object` that have function values. @@ -3293,7 +3293,7 @@ _.functions(_); ### `_.has(object, key)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5880 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5887 "View in source") [Ⓣ][1] Checks if the specified property name exists as a direct property of `object`, instead of an inherited property. @@ -3318,7 +3318,7 @@ _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b'); ### `_.invert(object, [multiValue=false])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5909 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5916 "View in source") [Ⓣ][1] Creates an object composed of the inverted keys and values of the given object. If the given object contains duplicate values, subsequent values will overwrite property assignments of previous values unless `multiValue` is `true`. @@ -3351,7 +3351,7 @@ _.invert({ 'first': 'fred', 'second': 'barney', 'third': 'fred' }, true); ### `_.isArguments(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2164 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L2172 "View in source") [Ⓣ][1] Checks if `value` is an `arguments` object. @@ -3378,7 +3378,7 @@ _.isArguments([1, 2, 3]); ### `_.isArray(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5950 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5957 "View in source") [Ⓣ][1] Checks if `value` is an array. @@ -3405,7 +3405,7 @@ _.isArray([1, 2, 3]); ### `_.isBoolean(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5968 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5975 "View in source") [Ⓣ][1] Checks if `value` is a boolean value. @@ -3429,7 +3429,7 @@ _.isBoolean(null); ### `_.isDate(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5986 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5993 "View in source") [Ⓣ][1] Checks if `value` is a date. @@ -3453,7 +3453,7 @@ _.isDate(new Date); ### `_.isElement(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6003 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6010 "View in source") [Ⓣ][1] Checks if `value` is a DOM element. @@ -3477,7 +3477,7 @@ _.isElement(document.body); ### `_.isEmpty(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6036 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6043 "View in source") [Ⓣ][1] Checks if `value` is empty. Arrays, strings, or `arguments` objects with a length of `0` and objects with no own enumerable properties are considered "empty". @@ -3507,7 +3507,7 @@ _.isEmpty(''); ### `_.isEqual(a, b, [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6093 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6100 "View in source") [Ⓣ][1] Performs a deep comparison between two values to determine if they are equivalent to each other. If a callback is provided it will be executed to compare values. If the callback returns `undefined` comparisons will be handled by the method instead. The callback is bound to `thisArg` and invoked with two arguments; *(a, b)*. @@ -3552,7 +3552,7 @@ _.isEqual(words, otherWords, function(a, b) { ### `_.isFinite(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6126 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6133 "View in source") [Ⓣ][1] Checks if `value` is, or can be coerced to, a finite number. @@ -3590,7 +3590,7 @@ _.isFinite(Infinity); ### `_.isFunction(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6143 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6150 "View in source") [Ⓣ][1] Checks if `value` is a function. @@ -3614,7 +3614,7 @@ _.isFunction(_); ### `_.isNaN(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6208 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6215 "View in source") [Ⓣ][1] Checks if `value` is `NaN`. @@ -3649,7 +3649,7 @@ _.isNaN(undefined); ### `_.isNull(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6230 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6237 "View in source") [Ⓣ][1] Checks if `value` is `null`. @@ -3676,7 +3676,7 @@ _.isNull(undefined); ### `_.isNumber(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6250 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6257 "View in source") [Ⓣ][1] Checks if `value` is a number. @@ -3702,7 +3702,7 @@ _.isNumber(8.4 * 5); ### `_.isObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6173 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6180 "View in source") [Ⓣ][1] Checks if `value` is the language type of Object. *(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)* @@ -3732,7 +3732,7 @@ _.isObject(1); ### `_.isPlainObject(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6280 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6287 "View in source") [Ⓣ][1] Checks if `value` is an object created by the `Object` constructor. @@ -3767,7 +3767,7 @@ _.isPlainObject({ 'x': 0, 'y': 0 }); ### `_.isRegExp(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6305 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6312 "View in source") [Ⓣ][1] Checks if `value` is a regular expression. @@ -3791,7 +3791,7 @@ _.isRegExp(/fred/); ### `_.isString(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6324 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6331 "View in source") [Ⓣ][1] Checks if `value` is a string. @@ -3815,7 +3815,7 @@ _.isString('fred'); ### `_.isUndefined(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6342 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6349 "View in source") [Ⓣ][1] Checks if `value` is `undefined`. @@ -3839,7 +3839,7 @@ _.isUndefined(void 0); ### `_.keys(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6359 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6366 "View in source") [Ⓣ][1] Creates an array composed of the own enumerable property names of an object. @@ -3863,7 +3863,7 @@ _.keys({ 'one': 1, 'two': 2, 'three': 3 }); ### `_.mapValues(object, [callback=identity], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6406 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6413 "View in source") [Ⓣ][1] Creates an object with the same keys as `object` and values generated by running each own enumerable property of `object` through the callback. The callback is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. @@ -3902,7 +3902,7 @@ _.mapValues(characters, 'age'); ### `_.merge(object, [source], [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6467 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6474 "View in source") [Ⓣ][1] Recursively merges own enumerable properties of the source object(s), that don't resolve to `undefined` into the destination object. Subsequent sources will overwrite property assignments of previous sources. If a callback is provided it will be executed to produce the merged values of the destination and source properties. If the callback returns `undefined` merging will be handled by the method instead. The callback is bound to `thisArg` and invoked with two arguments; *(objectValue, sourceValue)*. @@ -3958,7 +3958,7 @@ _.merge(food, otherFood, function(a, b) { ### `_.omit(object, [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6525 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6532 "View in source") [Ⓣ][1] Creates a shallow clone of `object` excluding the specified properties. Property names may be specified as individual arguments or as arrays of property names. If a callback is provided it will be executed for each property of `object` omitting the properties the callback returns truey for. The callback is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. @@ -3989,7 +3989,7 @@ _.omit({ 'name': 'fred', 'age': 40 }, function(value) { ### `_.pairs(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6573 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6580 "View in source") [Ⓣ][1] Creates a two dimensional array of an object's key-value pairs, i.e. `[[key1, value1], [key2, value2]]`. @@ -4013,7 +4013,7 @@ _.pairs({ 'barney': 36, 'fred': 40 }); ### `_.pick(object, [callback], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6613 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6620 "View in source") [Ⓣ][1] Creates a shallow clone of `object` composed of the specified properties. Property names may be specified as individual arguments or as arrays of property names. If a callback is provided it will be executed for each property of `object` picking the properties the callback returns truey for. The callback is bound to `thisArg` and invoked with three arguments; *(value, key, object)*. @@ -4044,7 +4044,7 @@ _.pick({ 'name': 'fred', '_userid': 'fred1' }, function(value, key) { ### `_.transform(object, [callback=identity], [accumulator], [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6669 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6676 "View in source") [Ⓣ][1] An alternative to `_.reduce`; this method transforms `object` to a new `accumulator` object which is the result of running each of its own enumerable properties through a callback, with each callback execution potentially mutating the `accumulator` object. The callback is bound to `thisArg` and invoked with four arguments; *(accumulator, value, key, object)*. Callbacks may exit iteration early by explicitly returning `false`. @@ -4081,7 +4081,7 @@ var mapped = _.transform({ 'a': 1, 'b': 2, 'c': 3 }, function(result, num, key) ### `_.values(object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6703 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6710 "View in source") [Ⓣ][1] Creates an array composed of the own enumerable property values of `object`. @@ -4112,7 +4112,7 @@ _.values({ 'one': 1, 'two': 2, 'three': 3 }); ### `_.capitalize(string)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6730 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6737 "View in source") [Ⓣ][1] Converts the first character of `string` to upper case. @@ -4136,7 +4136,7 @@ _.capitalize('fred'); ### `_.escape(string)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6759 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6766 "View in source") [Ⓣ][1] Converts the characters "&", "<", ">", '"', and "'" in `string` to their corresponding HTML entities. @@ -4164,9 +4164,9 @@ _.escape('fred, barney, & pebbles'); ### `_.template(text, [data], [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6855 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6862 "View in source") [Ⓣ][1] -Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, HTML escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" delimiters. If a data object is provided the interpolated template string will be returned. Data properties may be accessed as free variables in the template. If a settings object is provided it will override `_.templateSettings` for the template. +Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, HTML-escaped interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" delimiters. If a data object is provided the interpolated template string will be returned. Data properties may be accessed as free variables in the template. If a settings object is provided it will override `_.templateSettings` for the template. Note: In the development build, `_.template` utilizes sourceURLs for easier debugging. See [HTML5 Rocks' article on sourcemaps](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for more details. @@ -4186,7 +4186,7 @@ For more information on Chrome extension sandboxes see [Chrome's extensions 9. `[options.variable]` *(string)*: The data object variable name. #### Returns -*(Function, string)*: Returns the interpolated text if a data object if a data object is given, else it returns a template function. +*(Function, string)*: Returns the interpolated string if a data object is provided, else it returns a template function. #### Example ```js @@ -4256,7 +4256,7 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\ ### `_.trim(string, [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6972 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6979 "View in source") [Ⓣ][1] Removes leading and trailing whitespace or specified characters from `string`. @@ -4284,7 +4284,7 @@ _.trim('-_-fred-_-', '_-'); ### `_.trimLeft(string, [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6996 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7003 "View in source") [Ⓣ][1] Removes leading whitespace or specified characters from `string`. @@ -4312,7 +4312,7 @@ _.trimLeft('-_-fred-_-', '_-'); ### `_.trimRight(string, [chars=whitespace])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7020 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7027 "View in source") [Ⓣ][1] Removes trailing whitespace or specified characters from `string`. @@ -4340,7 +4340,7 @@ _.trimRight('-_-fred-_-', '_-'); ### `_.unescape(string)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7045 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7052 "View in source") [Ⓣ][1] The inverse of `_.escape`; this method converts the HTML entities `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding characters. @@ -4373,7 +4373,7 @@ _.unescape('fred, barney & pebbles'); ### `_.now` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7318 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7325 "View in source") [Ⓣ][1] *(unknown)*: Gets the number of milliseconds that have elapsed since the Unix epoch *(1 January `1970 00`:00:00 UTC)*. @@ -4392,7 +4392,7 @@ _.defer(function() { console.log(_.now() - stamp); }); ### `_.constant(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7070 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7077 "View in source") [Ⓣ][1] Creates a function that returns `value`. @@ -4418,7 +4418,7 @@ getter() === object; ### `_.createCallback([func=identity], [thisArg], [argCount])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7108 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7115 "View in source") [Ⓣ][1] Produces a callback bound to an optional `thisArg`. If `func` is a property name the created callback will return the property value for a given element. If `func` is an object the created callback will return `true` for elements that contain the equivalent object properties, otherwise it will return `false`. @@ -4460,7 +4460,7 @@ _.filter(characters, 'age__gt38'); ### `_.identity(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7132 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7139 "View in source") [Ⓣ][1] This method returns the first argument provided to it. @@ -4485,7 +4485,7 @@ _.identity(object) === object; ### `_.matches(source)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7161 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7168 "View in source") [Ⓣ][1] Creates a "_.where" style function, which performs a deep comparison between a given object and the `source` object, returning `true` if the given object has equivalent property values, else `false`. @@ -4519,7 +4519,7 @@ _.find(characters, matchesAge); ### `_.mixin([object=lodash], source, [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7224 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7231 "View in source") [Ⓣ][1] Adds function properties of a source object to the destination object. If `object` is a function methods will be added to its prototype as well. @@ -4557,7 +4557,7 @@ _('fred').vowels(); ### `_.noConflict()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7284 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7291 "View in source") [Ⓣ][1] Reverts the '_' variable to its previous value and returns a reference to the `lodash` function. @@ -4577,7 +4577,7 @@ var lodash = _.noConflict(); ### `_.noop()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7301 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7308 "View in source") [Ⓣ][1] A no-operation function. @@ -4596,7 +4596,7 @@ _.noop(object) === undefined; ### `_.parseInt(value, [radix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7342 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7349 "View in source") [Ⓣ][1] Converts `value` to an integer of the specified radix. If `radix` is `undefined` or `0` a `radix` of `10` is used unless the `value` is a hexadecimal, in which case a `radix` of `16` is used. @@ -4623,7 +4623,7 @@ _.parseInt('08'); ### `_.property(key)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7374 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7381 "View in source") [Ⓣ][1] Creates a "_.pluck" style function, which returns the `key` value of a given object. @@ -4657,7 +4657,7 @@ _.sortBy(characters, getName); ### `_.random([min=0], [max=1], [floating=false])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7407 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7414 "View in source") [Ⓣ][1] Produces a random number between `min` and `max` *(inclusive)*. If only one argument is provided a number between `0` and the given number will be returned. If `floating` is truey or either `min` or `max` are floats a floating-point number will be returned instead of an integer. @@ -4692,7 +4692,7 @@ _.random(1.2, 5.2); ### `_.result(object, key, [defaultValue])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7472 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7479 "View in source") [Ⓣ][1] Resolves the value of property `key` on `object`. If `key` is a function it will be invoked with the `this` binding of `object` and its result returned, else the property value is returned. If `object` is `null` or `undefined` then `undefined` is returned. If a default value is provided it will be returned if the property value resolves to `undefined`. @@ -4749,7 +4749,7 @@ Create a new `lodash` function using the given context object. ### `_.times(n, callback, [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7503 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7510 "View in source") [Ⓣ][1] Executes the callback `n` times, returning an array of the results of each callback execution. The callback is bound to `thisArg` and invoked with one argument; *(index)*. @@ -4781,7 +4781,7 @@ _.times(3, function(n) { this.cast(n); }, mage); ### `_.uniqueId([prefix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7531 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7538 "View in source") [Ⓣ][1] Generates a unique ID. If `prefix` is provided the ID will be appended to it. @@ -4834,7 +4834,7 @@ A reference to the `lodash` function. ### `_.VERSION` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7740 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L7747 "View in source") [Ⓣ][1] *(string)*: The semantic version number.