From bd4bff3b6b9ad88c915e50e467de786caef66079 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 19 Nov 2012 23:02:35 -0800 Subject: [PATCH] Add `lodash.prototype` methods that return non-wrapped values. Former-commit-id: b7ecb8c91ec9647827a80a297b966639c6580ef0 --- build.js | 5 +++- lodash.js | 14 +++++++++ lodash.min.js | 72 +++++++++++++++++++++++----------------------- test/test-build.js | 7 +++-- test/test.js | 50 ++++++++++++++++++++++++++++++-- 5 files changed, 107 insertions(+), 41 deletions(-) diff --git a/build.js b/build.js index 2c9abe3ce..b3a70f6bc 100755 --- a/build.js +++ b/build.js @@ -124,7 +124,7 @@ 'memoize': [], 'merge': ['forOwn', 'isArray', 'isPlainObject'], 'min': ['forEach', 'isArray', 'isString'], - 'mixin': ['forEach', 'functions'], + 'mixin': ['filter', 'forEach', 'functions'], 'noConflict': [], 'object': [], 'omit': ['forIn', 'indexOf'], @@ -1397,6 +1397,9 @@ }); }); + // remove Lo-Dash specific `lodash.prototype` extensions + source = source.replace(/(?:\s*\/\/.*)*\n( *)forEach\(filter[\s\S]+?lodash\.[\s\S]+?\n\1}.+/, ''); + // remove unneeded template related variables source = removeVar(source, 'reComplexDelimiter'); source = removeVar(source, 'reEmptyStringLeading'); diff --git a/lodash.js b/lodash.js index b1e3eeb39..645f26cbd 100644 --- a/lodash.js +++ b/lodash.js @@ -4225,6 +4225,20 @@ lodash.prototype.value = wrapperValue; lodash.prototype.valueOf = wrapperValue; + // add all methods that return non-wrapped values + forEach(filter(functions(lodash), function(methodName) { + return /^(?:contains|every|find|first|has|is[A-Z].+|last|reduce.*|some)$/.test(methodName); + }), + function(methodName) { + var func = lodash[methodName]; + + lodash.prototype[methodName] = function() { + var args = [this.__wrapped__]; + push.apply(args, arguments); + return func.apply(lodash, args); + }; + }); + // add all mutator Array functions to the wrapper. forEach(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { var func = arrayRef[methodName]; diff --git a/lodash.min.js b/lodash.min.js index 2fcb4242c..99d678b25 100644 --- a/lodash.min.js +++ b/lodash.min.js @@ -2,39 +2,39 @@ Lo-Dash 0.10.0 lodash.com/license Underscore.js 1.4.2 underscorejs.org/LICENSE */ -;(function(e,t){function s(e){if(e&&e.__wrapped__)return e;if(!(this instanceof s))return new s(e);this.__wrapped__=e}function o(e,t,n){t||(t=0);var r=e.length,i=r-t>=(n||Z);if(i)for(var s={},n=t-1;++nn||e===t)return 1;if(ei;i++)r+="i='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===l)&&"),r+="h.call(l,i)){x=l[i];"+e.g+"}"}if(e.b||e.h)r+="}";return r+=e.c+";return t",Function("e,h,j,k,p,n,s","return function("+t+"){"+r+"}")(l,bt,m,N,Gt,Lt,Et)}function h(e){return"\\"+ -Yt[e]}function p(e){return on[e]}function d(){}function v(e){return un[e]}function m(e){return xt.call(e)==_t}function g(e){var t=i;if(!e||"object"!=typeof e||m(e))return t;var n=e.constructor;return(!Vt||"function"==typeof e.toString||"string"!=typeof (e+""))&&(!x(n)||n instanceof n)?Rt?(rn(e,function(e,n,r){return t=!bt.call(r,n),i}),t===i):(rn(e,function(e,n){t=n}),t===i||bt.call(e,t)):t}function y(e){var t=[];return sn(e,function(e,n){t.push(n)}),t}function b(e,t,n,s,o){if(e==r)return e;n&&(t= -i);if(n=T(e)){var u=xt.call(e);if(!Qt[u]||Wt&&m(e))return e;var a=u==Dt,n=a||(u==jt?ln(e):n)}if(!n||!t)return n?a?St.call(e):nn({},e):e;n=e.constructor;switch(u){case Pt:case Ht:return new n(+e);case Bt:case It:return new n(e);case Ft:return n(e.source,ot.exec(e))}s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u];var f=a?n(e.length):{};return s.push(e),o.push(f),(a?hn:sn)(e,function(e,n){f[n]=b(e,t,r,s,o)}),f}function w(e){var t=[];return rn(e,function(e,n){x(e)&&t.push(n)}),t.sort() -}function E(e){var t={};return sn(e,function(e,n){t[e]=n}),t}function S(e,t,s,o){if(e===t)return 0!==e||1/e==1/t;if(e==r||t==r)return e===t;var u=xt.call(e);if(u!=xt.call(t))return i;switch(u){case Pt:case Ht:return+e==+t;case Bt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case Ft:case It:return e==t+""}var a=u==Dt||u==_t;if(Wt&&!a&&(a=m(e))&&!m(t))return i;if(!a){if(e.__wrapped__||t.__wrapped__)return S(e.__wrapped__||e,t.__wrapped__||t);if(u!=jt||Vt&&("function"!=typeof e.toString&&"string"==typeof -(e+"")||"function"!=typeof t.toString&&"string"==typeof (t+"")))return i;var u=e.constructor,f=t.constructor;if(u!=f&&(!x(u)||!(u instanceof u&&x(f)&&f instanceof f)))return i}s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u]==t;var u=-1,f=n,l=0;s.push(e),o.push(t);if(a){l=e.length;if(f=l==t.length)for(;l--&&(f=S(e[l],t[l],s,o)););return f}for(var c in e)if(bt.call(e,c)&&(l++,!bt.call(t,c)||!S(e[c],t[c],s,o)))return i;for(c in t)if(bt.call(t,c)&&!(l--))return i;if(qt)for(;7>++u;)if(c= -dt[u],bt.call(e,c)&&(!bt.call(t,c)||!S(e[c],t[c],s,o)))return i;return n}function x(e){return"function"==typeof e}function T(e){return e?Gt[typeof e]:i}function N(e){return xt.call(e)==It}function C(e,t,n){var i=arguments,s=0,o=2,u=i[3],a=i[4];n!==Y&&(u=[],a=[],"number"!=typeof n&&(o=i.length));for(;++sn?At(0,s+n):n)||0;return"number"==typeof s?o=-1<(N(e)?e.indexOf(t,n):q(e,t,n)):hn(e,function(e){if(++r>=n)return!(o=e===t)}),o}function A(e,t,r){var i=n,t=l(t,r);if(fn(e))for(var r=-1,s=e.length;++rr&&(r=n,o=e)});else for(;++io&&(o=e[i]);return o}function P(e,t){var n=[];return hn(e,function(e){n.push(e[t])}),n}function H(e,t,n,r){var s=3>arguments.length,t=l(t,r);return hn(e,function(e,r,o){n=s?(s=i,e):t(n,e,r,o)}),n}function B(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length;if("number"!=typeof o)var a=cn(e),o=a.length;else Xt&&N(e)&&(s=e.split(""));return hn(e,function(e,f,l){f=a?a[--o]:--o,n=u?(u=i,s[f]):t.call(r,n,s[f],f,l)}),n}function j(e,t,n){var r,t=l(t,n);if(fn(e))for(var n=-1,i=e.length;++nn?At(0,i+n):n||0)-1;else if(n)return r=U(e,t),e[r]===t?r:-1;for(;++r>>1,n(e[r])q(a,h))(n||f)&&a.push(h),u.push(r)}return u}function W(e,t){return Jt||Tt&&2|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,nt=/&(?:amp|lt|gt|quot|#x27);/g,rt=/\b__p\+='';/g,it=/\b(__p\+=)''\+/g,st=/(__e\(.*?\)|\b__t\))\+'';/g -,ot=/\w*$/,ut=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,at=RegExp("^"+(Q.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ft=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,lt=/<%=([\s\S]+?)%>/g,ct=/($^)/,ht=/[&<>"']/g,pt=/['\n\r\t\u2028\u2029\\]/g,dt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),vt=Math.ceil,mt=K.concat,gt=Math.floor,yt=at.test(yt=Object.getPrototypeOf)&&yt,bt=Q.hasOwnProperty,wt=K.push,Et= -Q.propertyIsEnumerable,St=K.slice,xt=Q.toString,Tt=at.test(Tt=St.bind)&&Tt,Nt=at.test(Nt=Array.isArray)&&Nt,Ct=e.isFinite,kt=e.isNaN,Lt=at.test(Lt=Object.keys)&&Lt,At=Math.max,Ot=Math.min,Mt=Math.random,_t="[object Arguments]",Dt="[object Array]",Pt="[object Boolean]",Ht="[object Date]",Bt="[object Number]",jt="[object Object]",Ft="[object RegExp]",It="[object String]",qt,Rt,Ut=(Ut={0:1,length:1},K.splice.call(Ut,0,1),Ut[0]),zt=n;(function(){function e(){this.x=1}var t=[];e.prototype={valueOf:1,y -:1};for(var n in new e)t.push(n);for(n in arguments)zt=!n;qt=!/valueOf/.test(t),Rt="x"!=t[0]})(1);var Wt=!m(arguments),Xt="xx"!="x"[0]+Object("x")[0];try{var Vt=("[object Object]",xt.call(e.document||0)==jt)}catch($t){}var Jt=Tt&&/\n|Opera/.test(Tt+xt.call(e.opera)),Kt=Lt&&/^.+$|true/.test(Lt+!!e.attachEvent),Qt={};Qt[_t]=Qt["[object Function]"]=i,Qt[Dt]=Qt[Pt]=Qt[Ht]=Qt[Bt]=Qt[jt]=Qt[Ft]=Qt[It]=n;var Gt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},Yt={"\\":"\\","'":"'","\n" -:"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:lt,variable:""};var Zt={a:"o,v,g",k:"for(var a=1,b=typeof g=='number'?2:arguments.length;a":">",'"':""","'":"'"},un=E(on),an=c(Zt,{g:"if(t[i]==null)"+Zt.g}),fn=Nt||function(e){return xt.call(e)==Dt};x(/x/)&&(x=function(e){return"[object Function]"==xt.call(e)});var ln=yt?function(e){if(!e||"object"!=typeof e)return i;var t=e.valueOf,n="function"==typeof t&&(n=yt(t))&&yt(n);return n?e==n||yt(e)==n&&!m(e):g(e)}:g,cn=Lt?function(e){return"function"==typeof e&&Et.call(e,"prototype")?y(e):T(e)?Lt(e):[]}:y,hn=c(en);s.VERSION="0.10.0",s.assign=nn,s.after=function(e,t){return 1> -e?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=W,s.bindAll=function(e){for(var t=arguments,n=1q(i,e)){for(var s=n;--s;)if(!(r[s]||(r[s]=o(t[s])))(e))return;i.push(e)}}),i},s.invert=E,s.invoke=function(e,t){var n=St.call(arguments,2),r="function"==typeof t,i=[];return hn(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},s.isArguments=m,s.isArray=fn,s.isBoolean=function(e){return e===n||e===i|| -xt.call(e)==Pt},s.isDate=function(e){return xt.call(e)==Ht},s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=function(e){var t=n;if(!e)return t;var r=xt.call(e),s=e.length;return r==Dt||r==It||r==_t||Wt&&m(e)||r==jt&&"number"==typeof s&&x(e.splice)?!s:(sn(e,function(){return t=i}),t)},s.isEqual=S,s.isFinite=function(e){return Ct(e)&&!kt(parseFloat(e))},s.isFunction=x,s.isNaN=function(e){return xt.call(e)==Bt&&e!=+e},s.isNull=function(e){return e===r},s.isNumber=function(e){return xt.call -(e)==Bt},s.isObject=T,s.isPlainObject=ln,s.isRegExp=function(e){return xt.call(e)==Ft},s.isString=N,s.isUndefined=function(e){return e===t},s.keys=cn,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:St.call(e,-t||i)}},s.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?At(0,r+n):Ot(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.map=_,s.max=D,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return bt.call -(n,r)?n[r]:n[r]=e.apply(this,arguments)}},s.merge=C,s.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||!fn(e))t=!t&&N(e)?u:l(t,n),hn(e,function(e,n,i){n=t(e,n,i),nq(s,n,1))i[n]=e}),i},s.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},s.pairs=function(e){var t=[];return sn(e,function(e,n){t.push([n,e])}),t},s.partial=function(e){return f(e,St.call(arguments,1))},s.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=0,s=mt.apply(K,arguments),o=s.length;++i=f?(clearTimeout(u),a=r,s=e.apply(o,i)):u||(u=setTimeout(n,f)), -s}},s.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r=(n||et);if(i)for(var s={},n=t-1;++nn||e===t)return 1;if(ei;i++)r+="i='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===l)&&"),r+="h.call(l,i)){x=l[i];"+e.g+"}"}if(e.b||e.h)r+="}";return r+=e.c+";return t",Function("e,h,j,k,p,n,s","return function("+t+"){"+r+"}")(l,wt,m,N,Yt,At,St)}function h(e){return"\\"+ +Zt[e]}function p(e){return un[e]}function d(){}function v(e){return an[e]}function m(e){return Tt.call(e)==Dt}function g(e){var t=i;if(!e||"object"!=typeof e||m(e))return t;var n=e.constructor;return(!$t||"function"==typeof e.toString||"string"!=typeof (e+""))&&(!x(n)||n instanceof n)?Ut?(sn(e,function(e,n,r){return t=!wt.call(r,n),i}),t===i):(sn(e,function(e,n){t=n}),t===i||wt.call(e,t)):t}function y(e){var t=[];return on(e,function(e,n){t.push(n)}),t}function b(e,t,n,s,o){if(e==r)return e;n&&(t= +i);if(n=T(e)){var u=Tt.call(e);if(!Gt[u]||Xt&&m(e))return e;var a=u==Pt,n=a||(u==Ft?cn(e):n)}if(!n||!t)return n?a?xt.call(e):rn({},e):e;n=e.constructor;switch(u){case Ht:case Bt:return new n(+e);case jt:case qt:return new n(e);case It:return n(e.source,ut.exec(e))}s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u];var f=a?n(e.length):{};return s.push(e),o.push(f),(a?pn:on)(e,function(e,n){f[n]=b(e,t,r,s,o)}),f}function w(e){var t=[];return sn(e,function(e,n){x(e)&&t.push(n)}),t.sort() +}function E(e){var t={};return on(e,function(e,n){t[e]=n}),t}function S(e,t,s,o){if(e===t)return 0!==e||1/e==1/t;if(e==r||t==r)return e===t;var u=Tt.call(e);if(u!=Tt.call(t))return i;switch(u){case Ht:case Bt:return+e==+t;case jt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case It:case qt:return e==t+""}var a=u==Pt||u==Dt;if(Xt&&!a&&(a=m(e))&&!m(t))return i;if(!a){if(e.__wrapped__||t.__wrapped__)return S(e.__wrapped__||e,t.__wrapped__||t);if(u!=Ft||$t&&("function"!=typeof e.toString&&"string"==typeof +(e+"")||"function"!=typeof t.toString&&"string"==typeof (t+"")))return i;var u=e.constructor,f=t.constructor;if(u!=f&&(!x(u)||!(u instanceof u&&x(f)&&f instanceof f)))return i}s||(s=[]),o||(o=[]);for(u=s.length;u--;)if(s[u]==e)return o[u]==t;var u=-1,f=n,l=0;s.push(e),o.push(t);if(a){l=e.length;if(f=l==t.length)for(;l--&&(f=S(e[l],t[l],s,o)););return f}for(var c in e)if(wt.call(e,c)&&(l++,!wt.call(t,c)||!S(e[c],t[c],s,o)))return i;for(c in t)if(wt.call(t,c)&&!(l--))return i;if(Rt)for(;7>++u;)if(c= +vt[u],wt.call(e,c)&&(!wt.call(t,c)||!S(e[c],t[c],s,o)))return i;return n}function x(e){return"function"==typeof e}function T(e){return e?Yt[typeof e]:i}function N(e){return Tt.call(e)==qt}function C(e,t,n){var i=arguments,s=0,o=2,u=i[3],a=i[4];n!==Z&&(u=[],a=[],"number"!=typeof n&&(o=i.length));for(;++sn?Ot(0,s+n):n)||0;return"number"==typeof s?o=-1<(N(e)?e.indexOf(t,n):q(e,t,n)):pn(e,function(e){if(++r>=n)return!(o=e===t)}),o}function A(e,t,r){var i=n,t=l(t,r);if(ln(e))for(var r=-1,s=e.length;++rr&&(r=n,o=e)});else for(;++io&&(o=e[i]);return o}function P(e,t){var n=[];return pn(e,function(e){n.push(e[t])}),n}function H(e,t,n,r){var s=3>arguments.length,t=l(t,r);return pn(e,function(e,r,o){n=s?(s=i,e):t(n,e,r,o)}),n}function B(e,t,n,r){var s=e,o=e?e.length:0,u=3>arguments.length;if("number"!=typeof o)var a=hn(e),o=a.length;else Vt&&N(e)&&(s=e.split(""));return pn(e,function(e,f,l){f=a?a[--o]:--o,n=u?(u=i,s[f]):t.call(r,n,s[f],f,l)}),n}function j(e,t,n){var r,t=l(t,n);if(ln(e))for(var n=-1,i=e.length;++nn?Ot(0,i+n):n||0)-1;else if(n)return r=U(e,t),e[r]===t?r:-1;for(;++r>>1,n(e[r])q(a,h))(n||f)&&a.push(h),u.push(r)}return u}function W(e,t){return Kt||Nt&&2|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,rt=/&(?:amp|lt|gt|quot|#x27);/g,it=/\b__p\+='';/g,st=/\b(__p\+=)''\+/g,ot=/(__e\(.*?\)|\b__t\))\+'';/g +,ut=/\w*$/,at=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g,ft=RegExp("^"+(G.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),lt=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,ct=/<%=([\s\S]+?)%>/g,ht=/($^)/,pt=/[&<>"']/g,dt=/['\n\r\t\u2028\u2029\\]/g,vt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),mt=Math.ceil,gt=Q.concat,yt=Math.floor,bt=ft.test(bt=Object.getPrototypeOf)&&bt,wt=G.hasOwnProperty,Et=Q.push,St= +G.propertyIsEnumerable,xt=Q.slice,Tt=G.toString,Nt=ft.test(Nt=xt.bind)&&Nt,Ct=ft.test(Ct=Array.isArray)&&Ct,kt=e.isFinite,Lt=e.isNaN,At=ft.test(At=Object.keys)&&At,Ot=Math.max,Mt=Math.min,_t=Math.random,Dt="[object Arguments]",Pt="[object Array]",Ht="[object Boolean]",Bt="[object Date]",jt="[object Number]",Ft="[object Object]",It="[object RegExp]",qt="[object String]",Rt,Ut,zt=(zt={0:1,length:1},Q.splice.call(zt,0,1),zt[0]),Wt=n;(function(){function e(){this.x=1}var t=[];e.prototype={valueOf:1,y +:1};for(var n in new e)t.push(n);for(n in arguments)Wt=!n;Rt=!/valueOf/.test(t),Ut="x"!=t[0]})(1);var Xt=!m(arguments),Vt="xx"!="x"[0]+Object("x")[0];try{var $t=("[object Object]",Tt.call(e.document||0)==Ft)}catch(Jt){}var Kt=Nt&&/\n|Opera/.test(Nt+Tt.call(e.opera)),Qt=At&&/^.+$|true/.test(At+!!e.attachEvent),Gt={};Gt[Dt]=Gt["[object Function]"]=i,Gt[Pt]=Gt[Ht]=Gt[Bt]=Gt[jt]=Gt[Ft]=Gt[It]=Gt[qt]=n;var Yt={"boolean":i,"function":n,object:n,number:i,string:i,"undefined":i},Zt={"\\":"\\","'":"'","\n" +:"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};s.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:ct,variable:""};var en={a:"o,v,g",k:"for(var a=1,b=typeof g=='number'?2:arguments.length;a":">",'"':""","'":"'"},an=E(un),fn=c(en,{g:"if(t[i]==null)"+en.g}),ln=Ct||function(e){return Tt.call(e)==Pt};x(/x/)&&(x=function(e){return"[object Function]"==Tt.call(e)});var cn=bt?function(e){if(!e||"object"!=typeof e)return i;var t=e.valueOf,n="function"==typeof t&&(n=bt(t))&&bt(n);return n?e==n||bt(e)==n&&!m(e):g(e)}:g,hn=At?function(e){return"function"==typeof e&&St.call(e,"prototype")?y(e):T(e)?At(e):[]}:y,pn=c(tn);s.VERSION="0.10.0",s.assign=rn,s.after=function(e,t){return 1> +e?t():function(){if(1>--e)return t.apply(this,arguments)}},s.bind=W,s.bindAll=function(e){for(var t=arguments,n=1q(i,e)){for(var s=n;--s;)if(!(r[s]||(r[s]=o(t[s])))(e))return;i.push(e)}}),i},s.invert=E,s.invoke=function(e,t){var n=xt.call(arguments,2),r="function"==typeof t,i=[];return pn(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},s.isArguments=m,s.isArray=ln,s.isBoolean=function(e){return e===n||e===i||Tt.call(e)==Ht},s.isDate=function( +e){return Tt.call(e)==Bt},s.isElement=function(e){return e?1===e.nodeType:i},s.isEmpty=function(e){var t=n;if(!e)return t;var r=Tt.call(e),s=e.length;return r==Pt||r==qt||r==Dt||Xt&&m(e)||r==Ft&&"number"==typeof s&&x(e.splice)?!s:(on(e,function(){return t=i}),t)},s.isEqual=S,s.isFinite=function(e){return kt(e)&&!Lt(parseFloat(e))},s.isFunction=x,s.isNaN=function(e){return Tt.call(e)==jt&&e!=+e},s.isNull=function(e){return e===r},s.isNumber=function(e){return Tt.call(e)==jt},s.isObject=T,s.isPlainObject= +cn,s.isRegExp=function(e){return Tt.call(e)==It},s.isString=N,s.isUndefined=function(e){return e===t},s.keys=hn,s.last=function(e,t,n){if(e){var i=e.length;return t==r||n?e[i-1]:xt.call(e,-t||i)}},s.lastIndexOf=function(e,t,n){var r=e?e.length:0;for("number"==typeof n&&(r=(0>n?Ot(0,r+n):Mt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},s.map=_,s.max=D,s.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return wt.call(n,r)?n[r]:n[r]=e.apply(this,arguments +)}},s.merge=C,s.min=function(e,t,n){var r=Infinity,i=-1,s=e?e.length:0,o=r;if(t||!ln(e))t=!t&&N(e)?u:l(t,n),pn(e,function(e,n,i){n=t(e,n,i),nq(s,n,1))i[n]=e}),i},s.once=function(e){var t,s=i;return function(){return s?t:(s=n,t=e.apply(this,arguments),e=r,t)}},s.pairs=function(e){var t=[];return on(e,function(e,n){t.push([n,e])}),t},s.partial=function(e){return f(e,xt.call(arguments,1))},s.pick=function(e,t,n){var r={};if("function"!=typeof t)for(var i=0,s=gt.apply(Q,arguments),o=s.length;++i=f?(clearTimeout(u),a=r,s=e.apply(o,i)):u||(u=setTimeout(n,f)),s}},s.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++ +r