Make _.where return all elements when the props object is empty.

This commit is contained in:
John-David Dalton
2014-04-04 09:16:59 -07:00
parent ff9aecca48
commit cff83e095a
6 changed files with 11 additions and 9 deletions

View File

@@ -32,7 +32,7 @@ for(u&&a&&(e=n[++i]);++i<a;)e=t(e,n[i],i,n)}else gt(n,function(n,r,o){e=u?(u=fal
else 2<o&&"function"==typeof r[o-1]&&(a=r[--o]);for(;++u<o;){t=r[u];for(var i=-1,l=Fr(t),f=l.length;++i<f;){var c=l[i];n[c]=a?a(n[c],t[c]):t[c]}}return n}function se(t){if(!t||2>arguments.length)return t;var e=Ut(arguments);return e.push(n),ce.apply(null,e)}function pe(n){var t=[];return wt(n,function(n,e){ve(n)&&t.push(e)}),t.sort()}function ge(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ye.call(n)==Q||false}function he(n){return n&&typeof n=="object"&&1===n.nodeType&&(Or.nodeClass?-1<Ye.call(n).indexOf("Element"):g(n))||false
}function ve(n){return typeof n=="function"}function ye(n){var t=typeof n;return n&&("function"==t||"object"==t)||false}function me(n){var t=typeof n;return"number"==t||n&&"object"==t&&Ye.call(n)==ot||false}function de(n){var t=typeof n;return n&&("function"==t||"object"==t)&&Ye.call(n)==at||false}function be(n){return typeof n=="string"||n&&typeof n=="object"&&Ye.call(n)==lt||false}function _e(n){if(!ye(n))return[];for(var t,e=n.length,e=(typeof e=="number"&&0<e&&(Lr(n)||Or.nonEnumStrings&&be(n)||Or.nonEnumArgs&&ge(n))&&e)>>>0,r=-1,u=e-1,o=Re(e),i=0<e,a=Or.enumErrorProps&&(n===Ue||n instanceof Le),l=Or.enumPrototypes&&typeof n=="function";++r<e;)o[r]=De(r);
for(var f in n)l&&"prototype"==f||a&&("message"==f||"name"==f)||i&&(t=+f,-1<t&&t<=u&&0==t%1)||o.push(f);if(Or.nonEnumShadows&&n!==Ze){if(t=n.constructor,r=-1,e=J.length,n===(t&&t.prototype))var c=n===Ke?lt:n===Ue?rt:Ye.call(n),c=kr[c];for(;++r<e;)f=J[r],c&&c[f]||!er.call(n,f)||o.push(f)}return o}function we(n,t,e){var r={};if(typeof t!="function")for(var u=-1,i=yt(arguments,true,false,1),a=ye(n)?i.length:0;++u<a;){var l=i[u];l in n&&(r[l]=n[l])}else t=o.createCallback(t,e,3),wt(n,function(n,e,u){t(n,e,u)&&(r[e]=n)
});return r}function xe(n){return At(n,Fr)}function Ce(n){return null==n?"":De(n).replace(M,"\\$&")}function je(n,t){var e="";if(t=+t,1>t||null==n||!gr(t))return e;n=De(n);do t%2&&(e+=n),t=Qe(t/2),n+=n;while(t);return e}function ke(n,t,e){var r=typeof n;return"function"==r||null==n?(typeof t=="undefined"||!("prototype"in n))&&n||Z(n,t,e):"object"!=r?Ie(n):Ee(n)}function Oe(n){return n}function Ee(n){n||(n={});var t=Fr(n),e=t.length,r=t[0],u=n[r];return 1!=e||u!==u||ye(u)?function(r){for(var u=e,o=false;u--&&(o=t[u],o=er.call(r,o)&&jt(r[o],n[o],null,true)););return o
});return r}function xe(n){return At(n,Fr)}function Ce(n){return null==n?"":De(n).replace(M,"\\$&")}function je(n,t){var e="";if(t=+t,1>t||null==n||!gr(t))return e;n=De(n);do t%2&&(e+=n),t=Qe(t/2),n+=n;while(t);return e}function ke(n,t,e){var r=typeof n;return"function"==r||null==n?(typeof t=="undefined"||!("prototype"in n))&&n||Z(n,t,e):"object"!=r?Ie(n):Ee(n)}function Oe(n){return n}function Ee(n){n||(n={});var t=Fr(n),e=t.length,r=t[0],u=n[r];return 1!=e||u!==u||ye(u)?function(r){for(var u=e,o=true;u--&&(o=t[u],o=er.call(r,o)&&jt(r[o],n[o],null,true)););return o
}:function(n){return er.call(n,r)?(n=n[r],u===n&&(0!==u||1/u==1/n)):false}}function Ae(n,t,e){var r=true,u=t&&pe(t);t&&(e||u.length)||(null==e&&(e=t),t=n,n=o,u=pe(t)),false===e?r=false:ye(e)&&"chain"in e&&(r=e.chain),e=-1;for(var i=ve(n),a=u?u.length:0;++e<a;){var l=u[e],f=n[l]=t[l];i&&(n.prototype[l]=function(t){return function(){var e=this.__chain__,u=this.__wrapped__,o=[u];if(rr.apply(o,arguments),o=t.apply(n,o),r||e){if(u===o&&ye(o))return this;o=new n(o),o.__chain__=e}return o}}(f))}}function Se(){}function Ie(n){return function(t){return null==t?w:t[n]
}}t=t?_t.defaults(mt.Object(),t,_t.pick(mt,H)):mt;var Re=t.Array,Ne=t.Boolean,Te=t.Date,Le=t.Error,We=t.Function,Fe=t.Math,$e=t.Number,Pe=t.Object,ze=t.RegExp,De=t.String,Be=t.TypeError,qe=Re.prototype,Ue=Le.prototype,Ze=Pe.prototype,Ke=De.prototype,Me=(Me=t.window)&&Me.document,Ve=t._,Xe=Fe.pow(2,53)-1,Ye=Ze.toString,Ge=ze("^"+Ce(Ye).replace(/toString|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),He=Fe.ceil,Je=t.clearTimeout,Qe=Fe.floor,nr=We.prototype.toString,tr=Lt(tr=Pe.getPrototypeOf)&&tr,er=Ze.hasOwnProperty,rr=qe.push,ur=Ze.propertyIsEnumerable,or=Lt(or=t.Set)&&or,ir=t.setTimeout,ar=qe.splice,lr=qe.unshift,fr=function(){try{var n={},t=Lt(t=Pe.defineProperty)&&t,e=t(n,n,n)&&t
}catch(r){}return e}(),cr=Lt(cr=Ke.contains)&&cr,sr=Lt(sr=Pe.create)&&sr,pr=Lt(pr=Re.isArray)&&pr,gr=t.isFinite,hr=t.isNaN,vr=Lt(vr=Pe.keys)&&vr,yr=Fe.max,mr=Fe.min,dr=Lt(dr=Te.now)&&dr,br=t.parseInt,_r=Fe.random,wr=Lt(wr=Ke.trim)&&!wr.call(G)&&wr,xr=Lt(xr=Ke.trimLeft)&&!xr.call(G)&&xr,Cr=Lt(Cr=Ke.trimRight)&&!Cr.call(G)&&Cr,jr={};jr[nt]=Re,jr[tt]=Ne,jr[et]=Te,jr[ut]=We,jr[it]=Pe,jr[ot]=$e,jr[at]=ze,jr[lt]=De;var kr={};kr[nt]=kr[et]=kr[ot]={constructor:true,toLocaleString:true,toString:true,valueOf:true},kr[tt]=kr[lt]={constructor:true,toString:true,valueOf:true},kr[rt]=kr[ut]=kr[at]={constructor:true,toString:true},kr[it]={constructor:true},function(){for(var n=J.length;n--;){var t,e=J[n];