Cleanup _.isEqual.

Former-commit-id: 83dd17b62fc86b870ca44aa4a54387343fd14cb2
This commit is contained in:
John-David Dalton
2013-02-08 22:47:43 -08:00
parent 8ffb3ab3c4
commit 9dfa2609be
7 changed files with 44 additions and 46 deletions

10
dist/lodash.min.js vendored
View File

@@ -5,13 +5,13 @@
* Underscore.js 1.4.4 underscorejs.org/LICENSE
*/
;(function(n,t){function r(n){return n&&typeof n=="object"&&n.__wrapped__?n:this instanceof r?(this.__wrapped__=n,void 0):new r(n)}function e(n,t,r){t||(t=0);var e=n.length,u=e-t>=(r||Y);if(u){var o={};for(r=t-1;++r<e;){var i=n[r]+"";(ht.call(o,i)?o[i]:o[i]=[]).push(n[r])}}return function(r){if(u){var e=r+"";return ht.call(o,e)&&-1<M(o[e],r)}return-1<M(n,r,t)}}function u(n){return n.charCodeAt(0)}function o(n,t){var r=n.b,e=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1
}return r<e?-1:1}function i(n,t,r,e){function u(){var a=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(a=a.length?(a=s(a),e?a.concat(r):r.concat(a)):r),this instanceof u?(p.prototype=n.prototype,c=new p,p.prototype=null,a=n.apply(c,a),w(a)?a:c):n.apply(c,a)}var o=b(n),i=!r,f=t;return i&&(r=t),o||(t=n),u}function f(n,r,e){if(null==n)return U;var u=typeof n;if("function"!=u){if("object"!=u)return function(t){return t[n]};var o=Qt(n);return function(r){for(var e=o.length,u=!1;e--&&(u=d(r[o[e]],n[o[e]],t,t,X)););return u
}}return typeof r!="undefined"?1===e?function(t){return n.call(r,t)}:2===e?function(t,e){return n.call(r,t,e)}:4===e?function(t,e,u,o){return n.call(r,t,e,u,o)}:function(t,e,u){return n.call(r,t,e,u)}:n}function a(){for(var n,t={g:It,b:"k(m)",c:"",h:"",l:"",m:!0},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];return n=t.a,t.d=/^[^,]+/.exec(n)[0],r=Function,e="var i,m="+t.d+",t=m;if(!m)return t;"+t.l+";",t.b&&(e+="var n=m.length;i=-1;if("+t.b+"){while(++i<n){"+t.h+"}}else{"),t.g&&t.m?e+="var r=-1,s=q[typeof m]?o(m):[],n=s.length;while(++r<n){i=s[r];"+t.h+"}":(e+="for(i in m){",t.m&&(e+="if(",t.m&&(e+="h.call(m,i)"),e+="){"),e+=t.h+";",t.m&&(e+="}"),e+="}"),t.b&&(e+="}"),e+=t.c+";return t",r("e,h,j,k,l,q,o","return function("+n+"){"+e+"}")(f,ht,g,Lt,x,Pt,jt)
}return r<e?-1:1}function i(n,t,r,e){function u(){var a=arguments,c=i?this:t;return o||(n=t[f]),r.length&&(a=a.length?(a=s(a),e?a.concat(r):r.concat(a)):r),this instanceof u?(p.prototype=n.prototype,c=new p,p.prototype=null,a=n.apply(c,a),w(a)?a:c):n.apply(c,a)}var o=b(n),i=!r,f=t;return i&&(r=t),o||(t=n),u}function f(n,t,r){if(null==n)return U;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Qt(n);return function(t){for(var r=u.length,e=!1;r--&&(e=d(t[u[r]],n[u[r]],X)););return e
}}return typeof t!="undefined"?1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}:n}function a(){for(var n,t={g:It,b:"k(m)",c:"",h:"",l:"",m:!0},r=0;n=arguments[r];r++)for(var e in n)t[e]=n[e];return n=t.a,t.d=/^[^,]+/.exec(n)[0],r=Function,e="var i,m="+t.d+",t=m;if(!m)return t;"+t.l+";",t.b&&(e+="var n=m.length;i=-1;if("+t.b+"){while(++i<n){"+t.h+"}}else{"),t.g&&t.m?e+="var r=-1,s=q[typeof m]?o(m):[],n=s.length;while(++r<n){i=s[r];"+t.h+"}":(e+="for(i in m){",t.m&&(e+="if(",t.m&&(e+="h.call(m,i)"),e+="){"),e+=t.h+";",t.m&&(e+="}"),e+="}"),t.b&&(e+="}"),e+=t.c+";return t",r("e,h,j,k,l,q,o","return function("+n+"){"+e+"}")(f,ht,g,Lt,x,Pt,jt)
}function c(n){return"\\"+Ct[n]}function l(n){return Wt[n]}function p(){}function s(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function v(n){return Xt[n]}function g(n){return mt.call(n)==Et}function h(n){var t=[];return Jt(n,function(n,r){t.push(r)}),t}function y(n,r,e,u,o,i){var a=n;if(typeof r=="function"&&(u=e,e=r,r=!1),typeof e=="function"){e=typeof u=="undefined"?e:f(e,u,1);var a=e(a),c=typeof a!="undefined";
c||(a=n)}if(u=w(a)){var l=mt.call(a);if(!Mt[l])return a;var p=Lt(a)}if(!u||!r)return u&&!c?p?s(a):Yt({},a):a;switch(u=zt[l],l){case qt:case kt:return c?a:new u(+a);case Nt:case Ft:return c?a:new u(a);case $t:return c?a:u(a.source,ut.exec(a))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return c||(a=p?u(a.length):{},p&&(ht.call(n,"index")&&(a.index=n.index),ht.call(n,"input")&&(a.input=n.input))),o.push(n),i.push(a),(p?N:Jt)(c?a:n,function(n,u){a[u]=y(n,r,e,t,o,i)}),a}function m(n){var t=[];
return Ht(n,function(n,r){b(n)&&t.push(r)}),t.sort()}function _(n){for(var t=-1,r=Qt(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function d(n,r,e,u,o,i,a){if(e){e=typeof u=="undefined"?e:f(e,u,2);var c=e(n,r);if(typeof c!="undefined")return!!c}if(n===r)return 0!==n||1/n==1/r;u=typeof n;var l=typeof r;if(n===n&&(!n||"function"!=u&&"object"!=u)&&(!r||"function"!=l&&"object"!=l))return!1;if(null==n||null==r)return n===r;if(l=mt.call(n),u=mt.call(r),l==Et&&(l=Rt),u==Et&&(u=Rt),l!=u)return!1;
switch(l){case qt:case kt:return+n==+r;case Nt:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case $t:case Ft:return n==r+""}if(u=l==St,!u){if(n.__wrapped__||r.__wrapped__)return d(n.__wrapped__||n,r.__wrapped__||r,e,t,o,i,a);if(l!=Rt)return!1;var l=n.constructor,p=r.constructor;if(l!=p&&(!b(l)||!(l instanceof l&&b(p)&&p instanceof p)))return!1}for(i||(i=[]),a||(a=[]),l=i.length;l--;)if(i[l]==n)return a[l]==r;var s=0,c=!0;if(i.push(n),a.push(r),u){if(s=r.length,c=o==X||s==n.length)for(;s--&&(c=d(n[s],r[s],e,t,o,i,a)););return c
}return Ht(r,function(r,u,f){return ht.call(f,u)?(s++,c=ht.call(n,u)&&d(n[u],r,e,t,o,i,a)):void 0}),c&&o!=X&&Ht(n,function(n,t,r){return ht.call(r,t)?c=-1<--s:void 0}),c}function b(n){return typeof n=="function"}function w(n){return n?Pt[typeof n]:!1}function j(n){return typeof n=="number"||mt.call(n)==Nt}function x(n){return typeof n=="string"||mt.call(n)==Ft}function A(n,t,r){var e=arguments,u=0,o=2;if(!w(n))return n;if(r===X)var i=e[3],a=e[4],c=e[5];else a=[],c=[],typeof r!="number"&&(o=e.length,"function"==typeof e[o-2]?i=f(e[--o-1],e[o--],2):"function"==typeof e[o-1]&&(i=e[--o]));
return Ht(n,function(n,r){b(n)&&t.push(r)}),t.sort()}function _(n){for(var t=-1,r=Qt(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function d(n,t,r,e,u,o){var i=r==X;if(r&&!i){r=typeof e=="undefined"?r:f(r,e,2);var a=r(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;var c=typeof n,l=typeof t;if(n===n&&(!n||"function"!=c&&"object"!=c)&&(!t||"function"!=l&&"object"!=l))return!1;if(null==n||null==t)return n===t;if(l=mt.call(n),c=mt.call(t),l==Et&&(l=Rt),c==Et&&(c=Rt),l!=c)return!1;
switch(l){case qt:case kt:return+n==+t;case Nt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case $t:case Ft:return n==t+""}if(c=l==St,!c){if(n.__wrapped__||t.__wrapped__)return d(n.__wrapped__||n,t.__wrapped__||t,r,e,u,o);if(l!=Rt)return!1;var l=n.constructor,p=t.constructor;if(l!=p&&(!b(l)||!(l instanceof l&&b(p)&&p instanceof p)))return!1}for(u||(u=[]),o||(o=[]),l=u.length;l--;)if(u[l]==n)return o[l]==t;var s=0,a=!0;if(u.push(n),o.push(t),c){if(s=t.length,a=i||s==n.length)for(;s--&&(a=d(n[s],t[s],r,e,u,o)););return a
}return Ht(t,function(t,i,f){return ht.call(f,i)?(s++,a=ht.call(n,i)&&d(n[i],t,r,e,u,o)):void 0}),a&&!i&&Ht(n,function(n,t,r){return ht.call(r,t)?a=-1<--s:void 0}),a}function b(n){return typeof n=="function"}function w(n){return n?Pt[typeof n]:!1}function j(n){return typeof n=="number"||mt.call(n)==Nt}function x(n){return typeof n=="string"||mt.call(n)==Ft}function A(n,t,r){var e=arguments,u=0,o=2;if(!w(n))return n;if(r===X)var i=e[3],a=e[4],c=e[5];else a=[],c=[],typeof r!="number"&&(o=e.length,"function"==typeof e[o-2]?i=f(e[--o-1],e[o--],2):"function"==typeof e[o-1]&&(i=e[--o]));
for(;++u<o;)(Lt(e[u])?N:Jt)(e[u],function(t,r){var e,u,o=t,f=n[r];if(t&&((u=Lt(t))||nr(t))){for(o=a.length;o--;)if(e=a[o]==t){f=c[o];break}e||(f=u?Lt(f)?f:[]:nr(f)?f:{},i&&(o=i(f,t),typeof o!="undefined"&&(f=o)),a.push(t),c.push(f),i||(f=A(f,t,X,i,a,c)))}else i&&(o=i(f,t),typeof o=="undefined"&&(o=t)),typeof o!="undefined"&&(f=o);n[r]=f});return n}function O(n){for(var t=-1,r=Qt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function E(n,t,r){var e=-1,u=n?n.length:0,o=!1;return r=(0>r?xt(0,u+r):r)||0,typeof u=="number"?o=-1<(x(n)?n.indexOf(t,r):M(n,t,r)):Gt(n,function(n){return++e<r?void 0:!(o=n===t)
}),o}function S(n,t,r){var e=!0;if(t=f(t,r),Lt(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else Gt(n,function(n,r,u){return e=!!t(n,r,u)});return e}function q(n,t,r){var e=[];if(t=f(t,r),Lt(n)){r=-1;for(var u=n.length;++r<u;){var o=n[r];t(o,r,n)&&e.push(o)}}else Gt(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function k(n,t,r){var e;return t=f(t,r),N(n,function(n,r,u){return t(n,r,u)?(e=n,!1):void 0}),e}function N(n,t,r){if(t&&typeof r=="undefined"&&Lt(n)){r=-1;for(var e=n.length;++r<e&&!1!==t(n[r],r,n););}else Gt(n,t,r);
return n}function R(n,t,r){var e=-1,u=n?n.length:0,o=Array(typeof u=="number"?u:0);if(t=f(t,r),Lt(n))for(;++e<u;)o[e]=t(n[e],e,n);else Gt(n,function(n,r,u){o[++e]=t(n,r,u)});return o}function $(n,t,r){var e=-1/0,o=e;if(!t&&Lt(n)){r=-1;for(var i=n.length;++r<i;){var a=n[r];a>o&&(o=a)}}else t=!t&&x(n)?u:f(t,r),Gt(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,o=n)});return o}function F(n,t,r,e){var u=3>arguments.length;if(t=f(t,e,4),Lt(n)){var o=-1,i=n.length;for(u&&(r=n[++o]);++o<i;)r=t(r,n[o],o,n)}else Gt(n,function(n,e,o){r=u?(u=!1,n):t(r,n,e,o)