UNPKG

@glyph-cat/equality

Version:
2 lines (1 loc) 1.03 kB
function t(t,n){if(!Object.is(t?.length,n?.length))return!1;for(let r=0;r<t.length;r++)if(!Object.is(t[r],n[r]))return!1;return!0}function n(t){return"object"==typeof t&&!function(t){return Object.is(t,null)}(t)}function r(t,r){if(n(t)&&n(r)){const n=Object.keys(t),e=Object.keys(r);if(n.length!==e.length)return!1;for(let u=0;u<n.length;u++){const c=n[u],f=e[u];if(c!==f)return!1;if(!Object.is(t[c],r[f]))return!1}return!0}return Object.is(t,r)}function e(n,e){const u=Array.isArray(n),c=Array.isArray(e);return u===c&&(u&&c?t(n,e):r(n,e))}const u="4b810e9ebb1acd002621ff1dd28db9481a8216f7",c="MJS",f="1.3.0";function o(t,n){return t?.toLowerCase?.()===n?.toLowerCase?.()}function i(t,n,r){return t?.toLocaleLowerCase?.(r)===n?.toLocaleLowerCase?.(r)}function b(t,n){return JSON.stringify(t)===JSON.stringify(n)}export{u as BUILD_HASH,c as BUILD_TYPE,f as VERSION,t as arrayIsShallowEqual,e as arrayOrObjectIsShallowEqual,o as isCaseInsensitiveEqual,b as isJSONequal,i as isLocaleCaseInsensitiveEqual,r as objectIsShallowEqual};