diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index eab1f41a8..13a04c52a 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -5679,7 +5679,9 @@ if (isCalled) { lastCalled = now(); result = func.apply(thisArg, args); - args = thisArg = null; + if (!timeoutId && !maxTimeoutId) { + args = thisArg = null; + } } } else { timeoutId = setTimeout(delayed, remaining); @@ -5694,7 +5696,9 @@ if (trailing || (maxWait !== wait)) { lastCalled = now(); result = func.apply(thisArg, args); - args = thisArg = null; + if (!timeoutId && !maxTimeoutId) { + args = thisArg = null; + } } }; @@ -5719,7 +5723,6 @@ } lastCalled = stamp; result = func.apply(thisArg, args); - args = thisArg = null; } else if (!maxTimeoutId) { maxTimeoutId = setTimeout(maxDelayed, remaining); @@ -5732,8 +5735,12 @@ timeoutId = setTimeout(delayed, wait); } if (leadingCall) { + isCalled = true; result = func.apply(thisArg, args); } + if (isCalled && !timeoutId && !maxTimeoutId) { + args = thisArg = null; + } return result; }; } diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index 70a834f3e..718798a0e 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -25,8 +25,8 @@ if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&We(n)){e=-1;for(var a=n. }),e}function $t(n){var t=-1,e=n?n.length:0,r=ne(typeof e=="number"?e:0);return Dt(n,function(n){var e=ft(0,++t);r[t]=r[e],r[e]=n}),r}function Lt(n,t,e){var r;if(t=v.createCallback(t,e,3),We(n)){e=-1;for(var u=n.length;++e=_&&u===n;if(f){var c=o(i);c?(u=t,i=c):f=!1}for(;++ru(i,c)&&l.push(c);return f&&p(i),l}function zt(n,t,e){var r=0,u=n?n.length:0; if(typeof t!="number"&&null!=t){var o=-1;for(t=v.createCallback(t,e,3);++or?Re(0,u+r):r||0}else if(r)return r=Wt(t,e),t[r]===e?r:-1;return n(t,e,r)}function Kt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=v.createCallback(t,e,3);++u>>1,e(n[r])e?0:e);++t=h; -m?(u&&(u=de(u)),c=a,o=n.apply(i,r),r=i=null):u||(u=Ee(y,h))}return m&&l?l=de(l):l||t===p||(l=Ee(v,t)),e&&(o=n.apply(i,r)),o}}function Vt(n){if(!jt(n))throw new fe;var t=s(arguments,1);return Ee(function(){n.apply(h,t)},1)}function Qt(n){return n}function Xt(n,t){var e=n,r=!t||jt(e);t||(e=y,t=n,n=v),Dt(_t(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return Ce.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:(r=new e(r),r.__chain__=this.__chain__,r) +}function Ut(n,t,e){var r,u,o,a,i,l,f,c=0,p=!1,s=!0;if(!jt(n))throw new fe;if(t=Re(0,t)||0,true===e)var g=!0,s=!1;else xt(e)&&(g=e.leading,p="maxWait"in e&&(Re(t,e.maxWait)||0),s="trailing"in e?e.trailing:s);var v=function(){var e=t-(xe()-a);0=h;m?(u&&(u=de(u)),c=a,o=n.apply(i,r)):u||(u=Ee(y,h))}return m&&l?l=de(l):l||t===p||(l=Ee(v,t)),e&&(m=!0,o=n.apply(i,r)),!m||l||u||(r=i=null),o}}function Vt(n){if(!jt(n))throw new fe;var t=s(arguments,1);return Ee(function(){n.apply(h,t)},1)}function Qt(n){return n}function Xt(n,t){var e=n,r=!t||jt(e);t||(e=y,t=n,n=v),Dt(_t(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return Ce.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:(r=new e(r),r.__chain__=this.__chain__,r) })})}function Yt(){}function Zt(){return this.__wrapped__}e=e?ut.defaults(Z.Object(),e,ut.pick(Z,R)):Z;var ne=e.Array,te=e.Boolean,ee=e.Date,re=e.Function,ue=e.Math,oe=e.Number,ae=e.Object,ie=e.RegExp,le=e.String,fe=e.TypeError,ce=[],pe=e.Error.prototype,se=ae.prototype,ge=le.prototype,he=e._,ve=se.toString,ye=ie("^"+le(ve).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),me=ue.ceil,de=e.clearTimeout,be=ue.floor,_e=re.prototype.toString,we=ye.test(we=ae.getPrototypeOf)&&we,je=se.hasOwnProperty,xe=ye.test(xe=ee.now)&&xe||function(){return+new ee },Ce=ce.push,ke=se.propertyIsEnumerable,Ee=e.setTimeout,Oe=ce.splice,Se=typeof(Se=rt&&et&&rt.setImmediate)=="function"&&!ye.test(Se)&&Se,Ie=function(){try{var n={},t=ye.test(t=ae.defineProperty)&&t,e=t(n,n,n)&&t}catch(r){}return e}(),Ae=ye.test(Ae=ae.create)&&Ae,De=ye.test(De=ne.isArray)&&De,Ne=e.isFinite,Be=e.isNaN,Pe=ye.test(Pe=ae.keys)&&Pe,Re=ue.max,Fe=ue.min,$e=e.parseInt,Le=ue.random,Te={};Te[L]=ne,Te[T]=te,Te[z]=ee,Te[K]=re,Te[G]=ae,Te[W]=oe,Te[J]=ie,Te[M]=le;var ze={};ze[L]=ze[z]=ze[W]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},ze[T]=ze[M]={constructor:!0,toString:!0,valueOf:!0},ze[q]=ze[K]=ze[J]={constructor:!0,toString:!0},ze[G]={constructor:!0},function(){for(var n=F.length;n--;){var t,e=F[n]; for(t in ze)je.call(ze,t)&&!je.call(ze[t],e)&&(ze[t][e]=!1)}}(),y.prototype=v.prototype;var qe=v.support={};!function(){var n=function(){this.x=1},t={0:1,length:1},r=[];n.prototype={valueOf:1,y:1};for(var u in new n)r.push(u);for(u in arguments);qe.argsClass=ve.call(arguments)==$,qe.argsObject=arguments.constructor==ae&&!(arguments instanceof ne),qe.enumErrorProps=ke.call(pe,"message")||ke.call(pe,"name"),qe.enumPrototypes=ke.call(n,"prototype"),qe.funcDecomp=!ye.test(e.WinRTError)&&B.test(g),qe.funcNames=typeof re.name=="string",qe.nonEnumArgs=0!=u,qe.nonEnumShadows=!/valueOf/.test(r),qe.ownLast="x"!=r[0],qe.spliceObjects=(ce.splice.call(t,0,1),!t[0]),qe.unindexedChars="xx"!="x"[0]+ae("x")[0]; diff --git a/dist/lodash.js b/dist/lodash.js index 92c7a8d36..32865dc19 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -5340,7 +5340,9 @@ if (isCalled) { lastCalled = now(); result = func.apply(thisArg, args); - args = thisArg = null; + if (!timeoutId && !maxTimeoutId) { + args = thisArg = null; + } } } else { timeoutId = setTimeout(delayed, remaining); @@ -5355,7 +5357,9 @@ if (trailing || (maxWait !== wait)) { lastCalled = now(); result = func.apply(thisArg, args); - args = thisArg = null; + if (!timeoutId && !maxTimeoutId) { + args = thisArg = null; + } } }; @@ -5380,7 +5384,6 @@ } lastCalled = stamp; result = func.apply(thisArg, args); - args = thisArg = null; } else if (!maxTimeoutId) { maxTimeoutId = setTimeout(maxDelayed, remaining); @@ -5393,8 +5396,12 @@ timeoutId = setTimeout(delayed, wait); } if (leadingCall) { + isCalled = true; result = func.apply(thisArg, args); } + if (isCalled && !timeoutId && !maxTimeoutId) { + args = thisArg = null; + } return result; }; } diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 05fbbf41f..0d7bde1dc 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -24,9 +24,9 @@ else o=[],g(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function Dt(n,t,e){var var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++oarguments.length;return t=Z.createCallback(t,r,4),Rt(n,function(n,r,o){e=u?(u=!1,n):t(e,n,r,o)}),e}function Bt(n){var t=-1,e=n?n.length:0,r=ne(typeof e=="number"?e:0);return Et(n,function(n){var e=lt(0,++t);r[t]=r[e],r[e]=n}),r}function Wt(n,t,e){var r;t=Z.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e=_&&u===n;if(l){var p=o(a);p?(u=t,a=p):l=!1}for(;++ru(a,p)&&f.push(p);return l&&c(a),f}function zt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=Z.createCallback(t,e,3);++or?Ae(0,u+r):r||0}else if(r)return r=Lt(t,e),t[r]===e?r:-1; return n(t,e,r)}function Kt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=Z.createCallback(t,e,3);++u>>1,e(n[r])e?0:e);++t=v;m?(i&&(i=ye(i)),s=f,a=n.apply(l,o),o=l=null):i||(i=ke(r,v))}return m&&c?c=ye(c):c||t===h||(c=ke(u,t)),e&&(a=n.apply(l,o)),a}}function Jt(n){if(!wt(n))throw new le;var t=p(arguments,1);return ke(function(){n.apply(v,t)},1)}function Qt(n){return n}function Xt(n,t){var e=n,r=!t||wt(e);t||(e=nt,t=n,n=Z),Et(bt(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t]; -return je.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:(r=new e(r),r.__chain__=this.__chain__,r)})})}function Yt(){}function Zt(){return this.__wrapped__}e=e?Y.defaults(G.Object(),e,Y.pick(G,A)):G;var ne=e.Array,te=e.Boolean,ee=e.Date,re=e.Function,ue=e.Math,oe=e.Number,ie=e.Object,ae=e.RegExp,fe=e.String,le=e.TypeError,ce=[],pe=ie.prototype,se=e._,ve=pe.toString,he=ae("^"+fe(ve).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),ge=ue.ceil,ye=e.clearTimeout,me=ue.floor,_e=re.prototype.toString,be=he.test(be=ie.getPrototypeOf)&&be,de=pe.hasOwnProperty,we=he.test(we=ee.now)&&we||function(){return+new ee +return r}function Vt(n,t){for(var e=-1,r=n?n.length:0,u={};++e=v;m?(i&&(i=ye(i)),s=f,a=n.apply(l,o)):i||(i=ke(r,v))}return m&&c?c=ye(c):c||t===h||(c=ke(u,t)),e&&(m=!0,a=n.apply(l,o)),!m||c||i||(o=l=null),a}}function Jt(n){if(!wt(n))throw new le;var t=p(arguments,1);return ke(function(){n.apply(v,t)},1)}function Qt(n){return n}function Xt(n,t){var e=n,r=!t||wt(e); +t||(e=nt,t=n,n=Z),Et(bt(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return je.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:(r=new e(r),r.__chain__=this.__chain__,r)})})}function Yt(){}function Zt(){return this.__wrapped__}e=e?Y.defaults(G.Object(),e,Y.pick(G,A)):G;var ne=e.Array,te=e.Boolean,ee=e.Date,re=e.Function,ue=e.Math,oe=e.Number,ie=e.Object,ae=e.RegExp,fe=e.String,le=e.TypeError,ce=[],pe=ie.prototype,se=e._,ve=pe.toString,he=ae("^"+fe(ve).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),ge=ue.ceil,ye=e.clearTimeout,me=ue.floor,_e=re.prototype.toString,be=he.test(be=ie.getPrototypeOf)&&be,de=pe.hasOwnProperty,we=he.test(we=ee.now)&&we||function(){return+new ee },je=ce.push,ke=e.setTimeout,xe=ce.splice,Ce=typeof(Ce=X&&Q&&X.setImmediate)=="function"&&!he.test(Ce)&&Ce,Oe=function(){try{var n={},t=he.test(t=ie.defineProperty)&&t,e=t(n,n,n)&&t}catch(r){}return e}(),Ie=he.test(Ie=ie.create)&&Ie,Ne=he.test(Ne=ne.isArray)&&Ne,Se=e.isFinite,Ee=e.isNaN,Re=he.test(Re=ie.keys)&&Re,Ae=ue.max,De=ue.min,$e=e.parseInt,Fe=ue.random,Te={};Te[$]=ne,Te[F]=te,Te[T]=ee,Te[B]=re,Te[q]=ie,Te[W]=oe,Te[z]=ae,Te[P]=fe,nt.prototype=Z.prototype;var Be=Z.support={};Be.funcDecomp=!he.test(e.a)&&E.test(s),Be.funcNames=typeof re.name=="string",Z.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:I,variable:"",imports:{_:Z}},Ie||(rt=function(){function n(){}return function(t){if(jt(t)){n.prototype=t; var r=new n;n.prototype=null}return r||e.Object()}}());var We=Oe?function(n,t){M.value=t,Oe(n,"__bindData__",M)}:Yt,qe=Ne||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n)==$||!1},ze=Re?function(n){return jt(n)?Re(n):[]}:J,Pe={"&":"&","<":"<",">":">",'"':""","'":"'"},Ke=dt(Pe),Le=ae("("+ze(Ke).join("|")+")","g"),Me=ae("["+ze(Pe).join("")+"]","g"),Ue=pt(function(n,t,e){de.call(n,e)?n[e]++:n[e]=1}),Ve=pt(function(n,t,e){(de.call(n,e)?n[e]:n[e]=[]).push(t) }),Ge=pt(function(n,t,e){n[e]=t});Ce&&(Jt=function(n){if(!wt(n))throw new le;return Ce.apply(e,arguments)});var He=8==$e(d+"08")?$e:function(n,t){return $e(xt(n)?n.replace(N,""):n,t||0)};return Z.after=function(n,t){if(!wt(t))throw new le;return function(){return 1>--n?t.apply(this,arguments):void 0}},Z.assign=H,Z.at=function(n){for(var t=arguments,e=-1,r=it(t,!0,!1,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=ne(t);++eu&&(u=t);else r=Q(r,t,3),F(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function M(n,r){var t=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++targuments.length;r=Q(r,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(t=n[++o]);++oarguments.length;return r=Q(r,e,4),q(n,function(n,e,o){t=u?(u=!1,n):r(t,n,e,o)}),t}function z(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return F(n,function(n){var t;t=++r,t=0+Or(Wr()*(t-0+1)),e[r]=e[t],e[t]=n}),e}function C(n,r,t){var e;r=Q(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++tt(u,i)&&o.push(i)}return o}function V(n,r,t){var u=0,o=n?n.length:0;if(typeof r!="number"&&null!=r){var i=-1;for(r=Q(r,t,3);++ie?Mr(0,u+e):e||0}else if(e)return e=J(r,t),r[e]===t?e:-1;return n(r,t,e) }function H(n,r,t){if(typeof r!="number"&&null!=r){var u=0,o=-1,i=n?n.length:0;for(r=Q(r,t,3);++o>>1,t(n[e])=y;m?(u&&(u=clearTimeout(u)),c=i,o=n.apply(f,e),e=f=null):u||(u=setTimeout(v,y))}return m&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(h,r)),t&&(o=n.apply(f,e)),o}}function Y(n){return n}function Z(n){F(w(n),function(r){var t=u[r]=n[r];u.prototype[r]=function(){var n=[this.__wrapped__];return Rr.apply(n,arguments),n=t.apply(u,n),this.__chain__?new o(n,!0):n -}})}var nr,rr=0,tr={},er=+new Date+"",ur=/($^)/,or=/['\n\r\t\u2028\u2029\\]/g,ir="[object Arguments]",fr="[object Array]",ar="[object Boolean]",lr="[object Date]",cr="[object Number]",pr="[object Object]",sr="[object RegExp]",gr="[object String]",hr={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},vr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},yr=hr[typeof window]&&window||this,mr=hr[typeof exports]&&exports&&!exports.nodeType&&exports,_r=hr[typeof module]&&module&&!module.nodeType&&module,dr=_r&&_r.exports===mr&&mr,br=hr[typeof global]&&global; +}function Q(n,r,t){var e=typeof n;if(null==n||"function"==e)return a(n,r,t);if("object"!=e)return function(r){return r[n]};var u=Ur(n);return function(r){for(var t=u.length,e=!1;t--&&(e=r[u[t]]===n[u[t]]););return e}}function X(n,r,t){var e,u,o,i,f,a,l,c=0,p=!1,s=!0;if(!A(n))throw new TypeError;if(r=Mr(0,r)||0,true===t)var g=!0,s=!1;else E(t)&&(g=t.leading,p="maxWait"in t&&(Mr(r,t.maxWait)||0),s="trailing"in t?t.trailing:s);var h=function(){var t=r-(Nr()-i);0=y;m?(u&&(u=clearTimeout(u)),c=i,o=n.apply(f,e)):u||(u=setTimeout(v,y))}return m&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(h,r)),t&&(m=!0,o=n.apply(f,e)),!m||a||u||(e=f=null),o}}function Y(n){return n}function Z(n){F(w(n),function(r){var t=u[r]=n[r];u.prototype[r]=function(){var n=[this.__wrapped__]; +return Rr.apply(n,arguments),n=t.apply(u,n),this.__chain__?new o(n,!0):n}})}var nr,rr=0,tr={},er=+new Date+"",ur=/($^)/,or=/['\n\r\t\u2028\u2029\\]/g,ir="[object Arguments]",fr="[object Array]",ar="[object Boolean]",lr="[object Date]",cr="[object Number]",pr="[object Object]",sr="[object RegExp]",gr="[object String]",hr={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},vr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},yr=hr[typeof window]&&window||this,mr=hr[typeof exports]&&exports&&!exports.nodeType&&exports,_r=hr[typeof module]&&module&&!module.nodeType&&module,dr=_r&&_r.exports===mr&&mr,br=hr[typeof global]&&global; !br||br.global!==br&&br.window!==br||(yr=br);var wr=[],jr=Object.prototype,xr=yr._,Ar=jr.toString,Er=RegExp("^"+(Ar+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Tr=Math.ceil,Or=Math.floor,Sr=jr.hasOwnProperty,Nr=Er.test(Nr=Date.now)&&Nr||function(){return+new Date},Rr=wr.push,kr=jr.propertyIsEnumerable,Br=Er.test(Br=Object.create)&&Br,Fr=Er.test(Fr=Array.isArray)&&Fr,qr=yr.isFinite,Dr=yr.isNaN,Ir=Er.test(Ir=Object.keys)&&Ir,Mr=Math.max,$r=Math.min,Wr=Math.random; o.prototype=u.prototype;var zr={};!function(){var n={0:1,length:1};zr.spliceObjects=(wr.splice.call(n,0,1),!n[0])}(1),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Br||(f=function(){function n(){}return function(r){if(E(r)){n.prototype=r;var t=new n;n.prototype=null}return t||yr.Object()}}()),_(arguments)||(_=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Sr.call(n,"callee")&&!kr.call(n,"callee")||!1});var Cr=Fr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ar.call(n)==fr||!1 -},Pr=function(n){var r,t=[];if(!n||!hr[typeof n])return t;for(r in n)Sr.call(n,r)&&t.push(r);return t},Ur=Ir?function(n){return E(n)?Ir(n):[]}:Pr,Vr={"&":"&","<":"<",">":">",'"':""","'":"'"},Gr=j(Vr),Hr=RegExp("("+Ur(Gr).join("|")+")","g"),Jr=RegExp("["+Ur(Vr).join("")+"]","g"),Kr=function(n,r){var t;if(!n||!hr[typeof n])return n;for(t in n)if(r(n[t],t,n)===tr)break;return n},Lr=function(n,r){var t;if(!n||!hr[typeof n])return n;for(t in n)if(Sr.call(n,t)&&r(n[t],t,n)===tr)break; +},Pr=function(n){var r,t=[];if(!n||!hr[typeof n])return t;for(r in n)Sr.call(n,r)&&t.push(r);return t},Ur=Ir?function(n){return E(n)?Ir(n):[]}:Pr,Vr={"&":"&","<":"<",">":">",'"':""","'":"'"},Gr=j(Vr),Hr=RegExp("("+Ur(Gr).join("|")+")","g"),Jr=RegExp("["+Ur(Vr).join("")+"]","g"),Kr=function(n,r){var t;if(!n||!hr[typeof n])return n;for(t in n)if(r(n[t],t,n)===true)break;return n},Lr=function(n,r){var t;if(!n||!hr[typeof n])return n;for(t in n)if(Sr.call(n,t)&&r(n[t],t,n)===true)break; return n};A(/x/)&&(A=function(n){return typeof n=="function"&&"[object Function]"==Ar.call(n)});var Qr=g(function(n,r,t){Sr.call(n,t)?n[t]++:n[t]=1}),Xr=g(function(n,r,t){(Sr.call(n,t)?n[t]:n[t]=[]).push(r)}),Yr=g(function(n,r,t){n[t]=r});u.after=function(n,r){if(!A(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},u.bind=L,u.bindAll=function(n){for(var r=1u(i,f)){for(var a=t;--a;)if(0>u(r[a],f))continue n; diff --git a/doc/README.md b/doc/README.md index 41ff3587e..896f83efa 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1087,7 +1087,7 @@ _.isArray(squares.value()); ### `_.chain(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6561 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6568 "View in source") [Ⓣ][1] Creates a `lodash` object that wraps the given value with explicit method chaining enabled. @@ -1121,7 +1121,7 @@ var youngest = _.chain(characters) ### `_.tap(value, interceptor)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6587 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6594 "View in source") [Ⓣ][1] Invokes `interceptor` with the `value` as the first argument and then returns `value`. The purpose of this method is to "tap into" a method chain in order to perform operations on intermediate results within the chain. @@ -1149,7 +1149,7 @@ _([1, 2, 3, 4]) ### `_.prototype.chain()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6617 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6624 "View in source") [Ⓣ][1] Enables explicit method chaining on the wrapper object. @@ -1183,7 +1183,7 @@ _(characters).chain() ### `_.prototype.toString()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6634 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6641 "View in source") [Ⓣ][1] Produces the `toString` result of the wrapped value. @@ -1204,7 +1204,7 @@ _([1, 2, 3]).toString(); ### `_.prototype.valueOf()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6651 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6658 "View in source") [Ⓣ][1] Extracts the wrapped value. @@ -2468,7 +2468,7 @@ source.addEventListener('message', _.debounce(batchLog, 250, { ### `_.defer(func, [arg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5774 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5781 "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. @@ -2493,7 +2493,7 @@ _.defer(function() { console.log('deferred'); }); ### `_.delay(func, wait, [arg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5808 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5815 "View in source") [Ⓣ][1] Executes the `func` function after `wait` milliseconds. Additional arguments will be provided to `func` when it is invoked. @@ -2520,7 +2520,7 @@ _.delay(log, 1000, 'logged later'); ### `_.memoize(func, [resolver])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5853 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5860 "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. @@ -2563,7 +2563,7 @@ get('pebbles'); ### `_.once(func)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5886 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5893 "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. @@ -2589,7 +2589,7 @@ initialize(); ### `_.partial(func, [arg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5924 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5931 "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. @@ -2616,7 +2616,7 @@ hi('fred'); ### `_.partialRight(func, [arg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5955 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5962 "View in source") [Ⓣ][1] This method is like `_.partial` except that `partial` arguments are appended to those provided to the new function. @@ -2653,7 +2653,7 @@ options.imports ### `_.throttle(func, wait, [options])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5990 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L5997 "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. @@ -2689,7 +2689,7 @@ jQuery('.interactive').on('click', _.throttle(renewToken, 300000, { ### `_.wrap(value, wrapper)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6031 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6038 "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. @@ -3944,7 +3944,7 @@ _.values({ 'one': 1, 'two': 2, 'three': 3 }); ### `_.noop` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6154 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6161 "View in source") [Ⓣ][1] *(unknown)*: A no-operation function. @@ -3963,7 +3963,7 @@ _.noop(object) === undefined; ### `_.escape(string)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6051 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6058 "View in source") [Ⓣ][1] Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding HTML entities. @@ -3987,7 +3987,7 @@ _.escape('Fred, Wilma, & Pebbles'); ### `_.identity(value)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6069 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6076 "View in source") [Ⓣ][1] This method returns the first argument provided to it. @@ -4012,7 +4012,7 @@ _.identity(object) === object; ### `_.mixin(object, object)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6096 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6103 "View in source") [Ⓣ][1] Adds function properties of a source object to the `lodash` function and chainable wrapper. @@ -4043,7 +4043,7 @@ _('fred').capitalize(); ### `_.noConflict()` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6137 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6144 "View in source") [Ⓣ][1] Reverts the '_' variable to its previous value and returns a reference to the `lodash` function. @@ -4063,7 +4063,7 @@ var lodash = _.noConflict(); ### `_.parseInt(value, [radix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6177 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6184 "View in source") [Ⓣ][1] Converts the given value into 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. @@ -4090,7 +4090,7 @@ _.parseInt('08'); ### `_.random([min=0], [max=1], [floating=false])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6209 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6216 "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. @@ -4125,7 +4125,7 @@ _.random(1.2, 5.2); ### `_.result(object, property)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6267 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6274 "View in source") [Ⓣ][1] Resolves the value of `property` on `object`. If `property` 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 falsey then `undefined` is returned. @@ -4178,7 +4178,7 @@ Create a new `lodash` function using the given context object. ### `_.template(text, data, [options], [options.escape], [options.evaluate], [options.imports], [options.interpolate], [sourceURL], [variable])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6360 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6367 "View in source") [Ⓣ][1] A micro-templating method that handles arbitrary delimiters, preserves whitespace, and correctly escapes quotes within interpolated code. @@ -4272,7 +4272,7 @@ fs.writeFileSync(path.join(cwd, 'jst.js'), '\ ### `_.times(n, callback, [thisArg])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6483 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6490 "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)*. @@ -4304,7 +4304,7 @@ _.times(3, function(n) { this.cast(n); }, mage); ### `_.unescape(string)` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6510 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6517 "View in source") [Ⓣ][1] The inverse of `_.escape` this method converts the HTML entities `&`, `<`, `>`, `"`, and `'` in `string` to their corresponding characters. @@ -4328,7 +4328,7 @@ _.unescape('Fred, Barney & Pebbles'); ### `_.uniqueId([prefix])` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6530 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6537 "View in source") [Ⓣ][1] Generates a unique ID. If `prefix` is provided the ID will be appended to it. @@ -4381,7 +4381,7 @@ A reference to the `lodash` function. ### `_.VERSION` -# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6851 "View in source") [Ⓣ][1] +# [Ⓢ](https://github.com/lodash/lodash/blob/master/lodash.js#L6858 "View in source") [Ⓣ][1] *(string)*: The semantic version number.