deep-equal-x
Version:
node's deepEqual and deepStrictEqual algorithm.
2 lines • 7.7 kB
JavaScript
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.returnExports=t()}}(function(){return function e(t,r,n){function s(i,u){if(!r[i]){if(!t[i]){var c="function"==typeof require&&require;if(!u&&c)return c(i,!0);if(o)return o(i,!0);var f=new Error("Cannot find module '"+i+"'");throw f.code="MODULE_NOT_FOUND",f}var l=r[i]={exports:{}};t[i][0].call(l.exports,function(e){var r=t[i][1][e];return s(r?r:e)},l,l.exports,e,t,r,n)}return r[i].exports}for(var o="function"==typeof require&&require,i=0;i<n.length;i++)s(n[i]);return s}({1:[function(t,e,r){!function(){"use strict";function isIndex(t){var e=-1;return h.call(q,t)&&(e=E(t)),e>-1&&e%1===0&&4294967295>e}function getItem(t,e,r,n){return r&&n?O.call(t,e):t[e]}function filterUnwanted(t,e){return e.length?m.call(t,function(t){return b.call(e,t)<0}):t}function baseDeepEqual(t,e,m,h){if(t===e)return!0;if(c(t)&&c(e))return t.length===e.length&&!j.call(t,function(t,r){return t!==e[r]});if(n(t)&&n(e))return w.call(t)===w.call(e);if(y(t)&&y(e))return S.call(t)===S.call(e)&&t.lastIndex===e.lastIndex;if(!u(t)&&!u(e))return m?t===e:t==e;if(p(t)||p(e))return!1;if(m&&A(t)!==A(e))return!1;if(i(t)||i(e))return t===e;var O=o(t),E=o(e);if(O&&!E||!O&&E)return!1;if(O)return O.length!==E.length?!1:baseDeepEqual(d.call(t),d.call(e),m,null);if(O=D(t),E=D(e),O.length!==E.length)return!1;u(t)&&(s(t)?O=filterUnwanted(O,r):l(t)?O=filterUnwanted(O,I):a(t)&&(O=filterUnwanted(O,F))),u(e)&&(s(e)?E=filterUnwanted(E,r):l(e)?E=filterUnwanted(E,I):a(e)&&(E=filterUnwanted(E,F))),v.call(O),v.call(E);var U,q;return k&&(U=f(t),q=f(e)),!j.call(O,function(r,n){if(r!==E[n])return!0;var o=(U||q)&&isIndex(r),u=h?h:[t],c=getItem(t,r,U,o),f=i(c);if(!f){if(b.call(u,c)>-1)throw new RangeError("Circular object");g.call(u,c)}var s=!baseDeepEqual(c,getItem(e,r,q,o),m,u);return f||x.call(u),s})}var r,n=t("is-date-object"),o=t("is-arguments"),i=t("is-primitive"),u=t("is-object"),c=t("is-buffer"),f=t("is-string"),s=t("is-error-x"),l=t("is-map-x"),a=t("is-set-x"),p=t("is-nil-x"),y=t("is-regex"),b=Array.prototype.indexOf,g=Array.prototype.push,x=Array.prototype.pop,d=Array.prototype.slice,j=Array.prototype.some,m=Array.prototype.filter,v=Array.prototype.sort,h=RegExp.prototype.test,S=RegExp.prototype.toString,O=String.prototype.charAt,w=Date.prototype.getTime,E=Number,D=Object.keys,A=Object.getPrototypeOf,U=Object("a"),k="a"!==U[0]||!(0 in U),q=/^(?:0|[1-9]\d*)$/,I="function"==typeof Map?D(new Map):[],F="function"==typeof Set?D(new Set):[];try{throw new Error("a")}catch(M){r=D(M)}e.exports=function deepEqual(t,e,r){return baseDeepEqual(t,e,r)}}()},{"is-arguments":4,"is-buffer":5,"is-date-object":6,"is-error-x":7,"is-map-x":9,"is-nil-x":10,"is-object":13,"is-primitive":14,"is-regex":15,"is-set-x":16,"is-string":17}],2:[function(t,e,r){!function(){"use strict";e.exports="function"==typeof Symbol&&"symbol"==typeof Symbol()}()},{}],3:[function(t,e,r){!function(){"use strict";e.exports=t("has-symbol-support-x")&&"symbol"==typeof Symbol.toStringTag}()},{"has-symbol-support-x":2}],4:[function(t,e,r){"use strict";var n=Object.prototype.toString,o=function isArguments(t){return"[object Arguments]"===n.call(t)},i=function isArguments(t){return o(t)?!0:null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==n.call(t)&&"[object Function]"===n.call(t.callee)},u=function(){return o(arguments)}();o.isLegacyArguments=i,e.exports=u?o:i},{}],5:[function(t,e,r){e.exports=function(t){return!(null==t||!(t._isBuffer||t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)))}},{}],6:[function(t,e,r){"use strict";var n=Date.prototype.getDay,o=function tryDateObject(t){try{return n.call(t),!0}catch(e){return!1}},i=Object.prototype.toString,u="[object Date]",c="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function isDateObject(t){return"object"!=typeof t||null===t?!1:c?o(t):i.call(t)===u}},{}],7:[function(t,e,r){!function(){"use strict";var r=t("to-string-tag-x"),n=t("is-object-like"),o=Object.getPrototypeOf,i=function checkIfError(t){return"[object Error]"===r(t)};if(!i(Error.prototype)){var u=Error.prototype,c=i;i=function checkIfError(t){return t===u||c(t)}}e.exports=function isError(t){if(!n(t))return!1;for(var e=t,r=100;e&&r>-1;){if(i(e))return!0;e=o(e),r-=1}return!1}}()},{"is-object-like":12,"to-string-tag-x":19}],8:[function(t,e,r){!function(){"use strict";function tryFunctionObject(t){try{return r.call(t),!0}catch(e){}return!1}var r=Function.prototype.toString,n=t("to-string-tag-x"),o=t("has-to-string-tag-x"),i=t("is-primitive"),u="[object Function]",c="[object GeneratorFunction]";e.exports=function isFunction(t){if(i(t))return!1;if(o)return tryFunctionObject(t);var e=n(t);return e===u||e===c}}()},{"has-to-string-tag-x":3,"is-primitive":14,"to-string-tag-x":19}],9:[function(t,e,r){!function(){"use strict";var r,n;if("function"==typeof Map)try{n=Object.getOwnPropertyDescriptor(Map.prototype,"size").get,n="number"==typeof n.call(new Map)&&n,r=t("is-object-like-x")}catch(o){n=null}e.exports=function isMap(t){if(!n||!r(t))return!1;try{return"number"==typeof n.call(t)}catch(e){}return!1}}()},{"is-object-like-x":11}],10:[function(t,e,r){!function(){"use strict";var r=t("validate.io-undefined"),n=t("lodash.isnull");e.exports=function isNil(t){return n(t)||r(t)}}()},{"lodash.isnull":18,"validate.io-undefined":20}],11:[function(t,e,r){!function(){"use strict";var r=t("is-function-x"),n=t("is-primitive");e.exports=function isObjectLike(t){return!n(t)&&!r(t)}}()},{"is-function-x":8,"is-primitive":14}],12:[function(t,e,r){"use strict";e.exports=function isObjectLike(t){return("object"==typeof t||"function"==typeof t)&&null!==t}},{}],13:[function(t,e,r){"use strict";e.exports=function isObject(t){return"object"==typeof t&&null!==t}},{}],14:[function(t,e,r){"use strict";e.exports=function isPrimitive(t){return null==t||"function"!=typeof t&&"object"!=typeof t}},{}],15:[function(t,e,r){"use strict";var n=RegExp.prototype.exec,o=function tryRegexExec(t){try{return n.call(t),!0}catch(e){return!1}},i=Object.prototype.toString,u="[object RegExp]",c="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function isRegex(t){return"object"!=typeof t?!1:c?o(t):i.call(t)===u}},{}],16:[function(t,e,r){!function(){"use strict";var r,n;if("function"==typeof Set)try{n=Object.getOwnPropertyDescriptor(Set.prototype,"size").get,n="number"==typeof n.call(new Set)&&n,r=t("is-object-like-x")}catch(o){n=null}e.exports=function isSet(t){if(!n||!r(t))return!1;try{return"number"==typeof n.call(t)}catch(e){}return!1}}()},{"is-object-like-x":11}],17:[function(t,e,r){"use strict";var n=String.prototype.valueOf,o=function tryStringObject(t){try{return n.call(t),!0}catch(e){return!1}},i=Object.prototype.toString,u="[object String]",c="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function isString(t){return"string"==typeof t?!0:"object"!=typeof t?!1:c?o(t):i.call(t)===u}},{}],18:[function(t,e,r){function isNull(t){return null===t}e.exports=isNull},{}],19:[function(t,e,r){!function(){"use strict";var r=Object.prototype.toString,n=t("lodash.isnull"),o=t("validate.io-undefined"),i="[object Null]",u="[object Undefined]";e.exports=function toStringTag(t){return n(t)?i:o(t)?u:r.call(t)}}()},{"lodash.isnull":18,"validate.io-undefined":20}],20:[function(t,e,r){"use strict";function isUndefined(t){return void 0===t}e.exports=isUndefined},{}]},{},[1])(1)});
//# sourceMappingURL=lib/deep-equal-x.map