Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hash-it

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hash-it - npm Package Compare versions

Comparing version 4.0.2 to 4.0.3

6

CHANGELOG.md
# hashIt CHANGELOG
## 4.0.3
- Upgrade to use babel 7 for builds
## 4.0.2
- Fix #38 - IE11 not allowing global `toString` to be used, instead using `Object.prototype.toString` (thanks [@JorgenEvens](https://github.com/JorgenEvens))
- Fix [#18](https://github.com/planttheidea/hash-it/pull/18) - IE11 not allowing global `toString` to be used, instead using `Object.prototype.toString` (thanks [@JorgenEvens](https://github.com/JorgenEvens))

@@ -7,0 +11,0 @@ ## 4.0.1

119

dist/hash-it.js

@@ -125,3 +125,2 @@ (function (global, factory) {

};
/**

@@ -139,6 +138,6 @@ * @function getCircularValue

*/
var getCircularValue = function getCircularValue(key, value, refCount) {
return '[ref-' + refCount + ']';
return "[ref-" + refCount + "]";
};
/**

@@ -154,2 +153,3 @@ * @function indexOf

*/
var indexOf = function indexOf(array, value) {

@@ -164,3 +164,2 @@ for (var index = 0; index < array.length; index++) {

};
/**

@@ -176,10 +175,9 @@ * @function createReplacer

*/
var createReplacer = function createReplacer(replacer, circularReplacer) {
var getCircularReplacer = circularReplacer || getCircularValue;
var hasReplacer = typeof replacer === 'function';
var cache = [],
locationOfThis = void 0,
locationOfValue = void 0;
locationOfThis,
locationOfValue;
return function (key, value) {

@@ -209,3 +207,2 @@ if (cache.length) {

// utils
/**

@@ -223,2 +220,3 @@ * @function stringify

*/
function stringify(value, replacer, indent, circularReplacer) {

@@ -234,46 +232,43 @@ return JSON.stringify(value, createReplacer(replacer, circularReplacer), indent);

var CIRCULAR_VALUE = '~';
/**
* @constant {boolean} HAS_BUFFER_FROM_SUPPORT
*/
var HAS_BUFFER_FROM_SUPPORT = typeof Buffer !== 'undefined' && typeof Buffer.from === 'function';
/**
* @constant {boolean} HAS_UINT16ARRAY_SUPPORT
*/
var HAS_UINT16ARRAY_SUPPORT = typeof Uint16Array === 'function';
/**
* @constant {RegExp} HTML_ELEMENT_REGEXP
*/
var HTML_ELEMENT_REGEXP = /\[object (HTML(.*)Element)\]/;
/**
* @constant {RegExp} SVG_ELEMENT_REGEXP
*/
var SVG_ELEMENT_REGEXP = /\[object (SVG(.*)Element)\]/;
/**
* @constant {Array<string>} OBJECT_CLASSES
*/
var OBJECT_CLASSES = ['Arguments', 'Array', 'ArrayBuffer', 'Boolean', 'DataView', 'Date', 'DocumentFragment', 'Error', 'Event', 'Float32Array', 'Float64Array', 'Function', 'Generator', 'GeneratorFunction', 'HTMLElement', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Null', 'Number', 'Object', 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'Undefined', 'WeakMap', 'WeakSet', 'Window'];
/**
* @constant {Object} OBJECT_CLASS_MAP
*/
var OBJECT_CLASS_MAP = OBJECT_CLASSES.reduce(function (objectClasses, type) {
objectClasses['[object ' + type + ']'] = type;
objectClasses["[object " + type + "]"] = type;
return objectClasses;
}, {});
/**
* @constant {Object} OBJECT_CLASS_TYPE_MAP
*/
var OBJECT_CLASS_TYPE_MAP = Object.keys(OBJECT_CLASS_MAP).reduce(function (objectClassTypes, objectClass) {
objectClassTypes[OBJECT_CLASS_MAP[objectClass].toUpperCase()] = objectClass;
return objectClassTypes;
}, {});
var ITERABLE_TAGS = {

@@ -283,3 +278,2 @@ '[object Map]': true,

};
var PRIMITIVE_TAGS = {

@@ -292,17 +286,11 @@ boolean: true,

};
var SELF_TAGS = (_SELF_TAGS = {}, _SELF_TAGS[OBJECT_CLASS_TYPE_MAP.ARGUMENTS] = true, _SELF_TAGS[OBJECT_CLASS_TYPE_MAP.ARRAY] = true, _SELF_TAGS);
var TOSTRING_TAGS = (_TOSTRING_TAGS = {}, _TOSTRING_TAGS[OBJECT_CLASS_TYPE_MAP.REGEXP] = true, _TOSTRING_TAGS[OBJECT_CLASS_TYPE_MAP.SYMBOL] = true, _TOSTRING_TAGS);
var TYPEDARRAY_TAGS = (_TYPEDARRAY_TAGS = {}, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.FLOAT32ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.FLOAT64ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.INT8ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.INT16ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.INT32ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT8ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT8CLAMPEDARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT16ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT32ARRAY] = true, _TYPEDARRAY_TAGS);
var UNPARSEABLE_TAGS = (_UNPARSEABLE_TAGS = {}, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.GENERATOR] = true, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.PROMISE] = true, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.WEAKMAP] = true, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.WEAKSET] = true, _UNPARSEABLE_TAGS);
// external dependencies
var charCodeAt = String.prototype.charCodeAt;
var toString = Object.prototype.toString;
var keys = Object.keys;
/**

@@ -317,6 +305,6 @@ * @function getFunctionName

*/
var getFunctionName = function getFunctionName(fn) {
return fn.name || (fn.toString().match(/^\s*function\s*([^\(]*)/i) || [])[1] || 'anonymous';
};
/**

@@ -330,6 +318,6 @@ * @function getCircularValue

*/
var getCircularValue$1 = function getCircularValue() {
return CIRCULAR_VALUE;
};
/**

@@ -346,2 +334,3 @@ * @function getIntegerHashValue

*/
var getIntegerHashValue = function getIntegerHashValue(string) {

@@ -351,7 +340,6 @@ var index = string.length,

hashB = 52711,
charCode = void 0;
charCode;
while (index--) {
charCode = charCodeAt.call(string, index);
hashA = hashA * 33 ^ charCode;

@@ -363,3 +351,2 @@ hashB = hashB * 33 ^ charCode;

};
/**

@@ -384,2 +371,3 @@ * @function getSortedEvent

*/
var getSortedEvent = function getSortedEvent(_ref) {

@@ -411,3 +399,2 @@ var bubbles = _ref.bubbles,

};
/**

@@ -423,6 +410,6 @@ * @function shouldSort

*/
var shouldSort = function shouldSort(valueA, valueB) {
return valueA > valueB;
};
/**

@@ -438,6 +425,6 @@ * @function shouldSortPair

*/
var shouldSortPair = function shouldSortPair(pairA, pairB) {
return shouldSort(pairA[0], pairB[0]);
};
/**

@@ -453,6 +440,6 @@ * @function getPrefixedValue

*/
var getPrefixedValue = function getPrefixedValue(tag, value) {
return tag + '|' + value;
return tag + "|" + value;
};
/**

@@ -468,5 +455,5 @@ * @function sort

*/
var sort = function sort(array, fn) {
var subIndex = void 0,
value = void 0;
var subIndex, value;

@@ -485,3 +472,2 @@ for (var index = 0; index < array.length; index++) {

};
/**

@@ -496,6 +482,6 @@ * @function getIterablePairs

*/
var getSortedIterablePairs = function getSortedIterablePairs(iterable) {
var isMap = typeof iterable.get === 'function';
var pairs = [];
iterable.forEach(function (value, key) {

@@ -505,18 +491,13 @@ // eslint-disable-next-line no-use-before-define

});
sort(pairs, shouldSortPair);
var finalPairs = new Array(iterable.size);
var pair;
var pair = void 0;
for (var index = 0; index < iterable.size; index++) {
pair = pairs[index];
finalPairs[index] = isMap ? '[' + pair[0] + ',' + pair[1] + ']' : pair[0];
finalPairs[index] = isMap ? "[" + pair[0] + "," + pair[1] + "]" : pair[0];
}
return getPrefixedValue(getFunctionName(iterable.constructor), '[' + finalPairs.join(',') + ']');
return getPrefixedValue(getFunctionName(iterable.constructor), "[" + finalPairs.join(',') + "]");
};
/**

@@ -531,11 +512,10 @@ * @function getSortedObject

*/
var getSortedObject = function getSortedObject(object) {
var objectKeys = sort(keys(object), shouldSort);
var newObject = {};
var key;
var key = void 0;
for (var index = 0; index < objectKeys.length; index++) {
key = objectKeys[index];
newObject[key] = object[key];

@@ -546,3 +526,2 @@ }

};
/**

@@ -557,6 +536,6 @@ * @function getStringifiedArrayBufferFallback

*/
var getStringifiedArrayBufferFallback = function getStringifiedArrayBufferFallback(buffer) {
return String.fromCharCode.apply(null, new Uint16Array(buffer));
};
/**

@@ -571,6 +550,6 @@ * @function getStringifiedArrayBufferModern

*/
var getStringifiedArrayBufferModern = function getStringifiedArrayBufferModern(buffer) {
return Buffer.from(buffer).toString('utf8');
};
/**

@@ -584,6 +563,6 @@ * @function getStringifiedArrayBufferNoSupport

*/
var getStringifiedArrayBufferNoSupport = function getStringifiedArrayBufferNoSupport() {
return '';
};
/**

@@ -598,6 +577,6 @@ * @function getStringifiedArrayBuffer

*/
var getStringifiedArrayBuffer = function () {
return HAS_BUFFER_FROM_SUPPORT ? getStringifiedArrayBufferModern : HAS_UINT16ARRAY_SUPPORT ? getStringifiedArrayBufferFallback : getStringifiedArrayBufferNoSupport;
}();
/**

@@ -612,5 +591,5 @@ * @function getStringifiedDocumentFragment

*/
var getStringifiedDocumentFragment = function getStringifiedDocumentFragment(fragment) {
var children = fragment.children;
var innerHTML = '';

@@ -625,3 +604,2 @@

};
/**

@@ -637,2 +615,3 @@ * @function indexOf

*/
var indexOf$1 = function indexOf(array, value) {

@@ -647,3 +626,2 @@ for (var index = 0; index < array.length; index++) {

};
/**

@@ -659,2 +637,3 @@ * @function getNormalizedValue

*/
var getNormalizedValue = function getNormalizedValue(value, sortedCache) {

@@ -687,3 +666,2 @@ var type = typeof value;

sortedCache.push(value);
return getSortedObject(value, sortedCache);

@@ -702,3 +680,2 @@ }

sortedCache.push(value);
return getSortedIterablePairs(value);

@@ -745,3 +722,2 @@ }

};
/**

@@ -756,2 +732,3 @@ * @function replacer

*/
var createReplacer$1 = function createReplacer(sortedCache) {

@@ -762,3 +739,2 @@ return function (key, value) {

};
/**

@@ -773,2 +749,3 @@ * @function stringify

*/
function stringify$1(value) {

@@ -779,3 +756,2 @@ return typeof value === 'object' && value && !(value instanceof RegExp || value instanceof Date) ? stringify(value, createReplacer$1([]), null, getCircularValue$1) : getNormalizedValue(value);

// external dependencies
/**

@@ -790,6 +766,6 @@ * @function hash

*/
var hash = function hash(value) {
return getIntegerHashValue(stringify$1(value));
};
/**

@@ -804,6 +780,6 @@ * @function hash.is

*/
hash.is = curry(function (object, otherObject) {
return hash(object) === hash(otherObject);
});
/**

@@ -818,4 +794,5 @@ * @function hash.is.all

*/
hash.is.all = curry(function () {
for (var _len = arguments.length, objects = Array(_len), _key = 0; _key < _len; _key++) {
for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {
objects[_key] = arguments[_key];

@@ -834,3 +811,2 @@ }

}, 2);
/**

@@ -845,4 +821,5 @@ * @function hash.is.any

*/
hash.is.any = curry(function () {
for (var _len2 = arguments.length, objects = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
for (var _len2 = arguments.length, objects = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
objects[_key2] = arguments[_key2];

@@ -861,3 +838,2 @@ }

}, 2);
/**

@@ -872,2 +848,3 @@ * @function hash.is.not

*/
hash.is.not = curry(function (object, otherObject) {

@@ -874,0 +851,0 @@ return hash(object) !== hash(otherObject);

@@ -1,1 +0,1 @@

!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(n.hashIt={})}(this,function(n){"use strict";var u="function"==typeof Symbol?Symbol("curriable placeholder"):60881;function r(r){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:r.length;function e(){var n=arguments;return n.length>=t&&!function(n,r){for(var t=0;t<r;t++)if(n[t]===u)return!0;return!1}(n,t)?r.apply(this,n):function(){return e.apply(this,function(n,r){for(var t=new Array(n.length),e=0,o=0;o<n.length;o++)t[o]=n[o]===u&&e<r.length?r[e++]:n[o];if(e<r.length)for(;e<r.length;e++)t.push(r[e]);return t}(n,arguments))}}return e.arity=t,e.fn=r,e}r.__=u,r.uncurry=function(n){return n.fn};var t,e,o,i,a=function(n,r,t){return"[ref-"+t+"]"},c=function(n,r){for(var t=0;t<n.length;t++)if(n[t]===r)return t;return-1},f=function(t,n){var e=n||a,o="function"==typeof t,u=[],i=void 0,f=void 0;return function(n,r){if(u.length){if(~(i=c(u,this))?u=function(n,r){for(var t=new Array(r),e=0;e<r;e++)t[e]=n[e];return t}(u,i+1):u[u.length]=this,~(f=c(u,r)))return e.call(this,n,r,f)}else u[0]=r;return o?t.call(this,n,r):r}};var l="undefined"!=typeof Buffer&&"function"==typeof Buffer.from,s="function"==typeof Uint16Array,A=/\[object (HTML(.*)Element)\]/,y=/\[object (SVG(.*)Element)\]/,h=["Arguments","Array","ArrayBuffer","Boolean","DataView","Date","DocumentFragment","Error","Event","Float32Array","Float64Array","Function","Generator","GeneratorFunction","HTMLElement","Int8Array","Int16Array","Int32Array","Map","Null","Number","Object","Promise","RegExp","Set","String","Symbol","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","Undefined","WeakMap","WeakSet","Window"].reduce(function(n,r){return n["[object "+r+"]"]=r,n},{}),p=Object.keys(h).reduce(function(n,r){return n[h[r].toUpperCase()]=r,n},{}),d={"[object Map]":!0,"[object Set]":!0},g={boolean:!0,function:!0,number:!0,string:!0,undefined:!0},v=((t={})[p.ARGUMENTS]=!0,t[p.ARRAY]=!0,t),R=((e={})[p.REGEXP]=!0,e[p.SYMBOL]=!0,e),b=((o={})[p.FLOAT32ARRAY]=!0,o[p.FLOAT64ARRAY]=!0,o[p.INT8ARRAY]=!0,o[p.INT16ARRAY]=!0,o[p.INT32ARRAY]=!0,o[p.UINT8ARRAY]=!0,o[p.UINT8CLAMPEDARRAY]=!0,o[p.UINT16ARRAY]=!0,o[p.UINT32ARRAY]=!0,o),E=((i={})[p.GENERATOR]=!0,i[p.PROMISE]=!0,i[p.WEAKMAP]=!0,i[p.WEAKSET]=!0,i),T=String.prototype.charCodeAt,m=Object.prototype.toString,S=Object.keys,N=function(){return"~"},M=function(n,r){return r<n},U=function(n,r){return M(n[0],r[0])},O=function(n,r){return n+"|"+r},j=function(n,r){for(var t=void 0,e=void 0,o=0;o<n.length;o++){for(e=n[o],t=o-1;~t&&r(n[t],e);t--)n[t+1]=n[t];n[t+1]=e}return n},I=l?function(n){return Buffer.from(n).toString("utf8")}:s?function(n){return String.fromCharCode.apply(null,new Uint16Array(n))}:function(){return""},Y=function(n,r){for(var t=0;t<n.length;t++)if(n[t]===r)return t;return-1},B=function(n,r){var t=typeof n;if("string"===t)return n;if(g[t])return O(t,n);if(null===n)return O("null",n);var e,o=m.call(n);return v[o]?n:o===p.OBJECT?~Y(r,n)?"~":(r.push(n),function(n){for(var r=j(S(n),M),t={},e=void 0,o=0;o<r.length;o++)t[e=r[o]]=n[e];return t}(n)):R[o]?O(h[o],n.toString()):d[o]?~Y(r,n)?"~":(r.push(n),function(n){var t="function"==typeof n.get,e=[];n.forEach(function(n,r){e.push(t?[P(r),P(n)]:[P(n)])}),j(e,U);for(var r,o=new Array(n.size),u=void 0,i=0;i<n.size;i++)u=e[i],o[i]=t?"["+u[0]+","+u[1]+"]":u[0];return O((r=n.constructor).name||(r.toString().match(/^\s*function\s*([^\(]*)/i)||[])[1]||"anonymous","["+o.join(",")+"]")}(n)):o===p.DATE?O(h[o],n.getTime()):o===p.ERROR?O(h[o],n.stack):o===p.EVENT?{bubbles:(e=n).bubbles,cancelBubble:e.cancelBubble,cancelable:e.cancelable,composed:e.composed,currentTarget:e.currentTarget,defaultPrevented:e.defaultPrevented,eventPhase:e.eventPhase,isTrusted:e.isTrusted,returnValue:e.returnValue,target:e.target,type:e.type}:E[o]?O(h[o],"NOT_ENUMERABLE"):A.test(o)||y.test(o)?O(o.slice(8,-1),n.outerHTML):o===p.DOCUMENTFRAGMENT?O(h[o],function(n){for(var r=n.children,t="",e=0;e<r.length;e++)t+=r[e].outerHTML;return t}(n)):b[o]?O(h[o],n.join(",")):o===p.ARRAYBUFFER?O(h[o],I(n)):o===p.DATAVIEW?O(h[o],I(n.buffer)):n},F=function(t){return function(n,r){return B(r,t)}};function P(n){return"object"==typeof n&&n&&!(n instanceof RegExp||n instanceof Date)?(r=n,t=F([]),e=null,o=N,JSON.stringify(r,f(t,o),e)):B(n);var r,t,e,o}var L=function(n){return function(n){for(var r=n.length,t=5381,e=52711,o=void 0;r--;)t=33*t^(o=T.call(n,r)),e=33*e^o;return 4096*(t>>>0)+(e>>>0)}(P(n))};(L.is=r(function(n,r){return L(n)===L(r)})).all=r(function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];for(var e=L.is(r.shift()),o=0;o<r.length;o++)if(!e(r[o]))return!1;return!0},2),L.is.any=r(function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];for(var e=L.is(r.shift()),o=0;o<r.length;o++)if(e(r[o]))return!0;return!1},2),L.is.not=r(function(n,r){return L(n)!==L(r)}),n.hash=L,n.default=L,Object.defineProperty(n,"__esModule",{value:!0})});
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(n.hashIt={})}(this,function(n){"use strict";var o="function"==typeof Symbol?Symbol("curriable placeholder"):60881;function r(r){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:r.length;function e(){var n=arguments;return n.length>=t&&!function(n,r){for(var t=0;t<r;t++)if(n[t]===o)return!0;return!1}(n,t)?r.apply(this,n):function(){return e.apply(this,function(n,r){for(var t=new Array(n.length),e=0,u=0;u<n.length;u++)t[u]=n[u]===o&&e<r.length?r[e++]:n[u];if(e<r.length)for(;e<r.length;e++)t.push(r[e]);return t}(n,arguments))}}return e.arity=t,e.fn=r,e}r.__=o,r.uncurry=function(n){return n.fn};var t,e,u,f,a=function(n,r,t){return"[ref-"+t+"]"},c=function(n,r){for(var t=0;t<n.length;t++)if(n[t]===r)return t;return-1},i=function(t,n){var e,u,o=n||a,f="function"==typeof t,i=[];return function(n,r){if(i.length){if(~(e=c(i,this))?i=function(n,r){for(var t=new Array(r),e=0;e<r;e++)t[e]=n[e];return t}(i,e+1):i[i.length]=this,~(u=c(i,r)))return o.call(this,n,r,u)}else i[0]=r;return f?t.call(this,n,r):r}};var l="undefined"!=typeof Buffer&&"function"==typeof Buffer.from,s="function"==typeof Uint16Array,A=/\[object (HTML(.*)Element)\]/,y=/\[object (SVG(.*)Element)\]/,h=["Arguments","Array","ArrayBuffer","Boolean","DataView","Date","DocumentFragment","Error","Event","Float32Array","Float64Array","Function","Generator","GeneratorFunction","HTMLElement","Int8Array","Int16Array","Int32Array","Map","Null","Number","Object","Promise","RegExp","Set","String","Symbol","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","Undefined","WeakMap","WeakSet","Window"].reduce(function(n,r){return n["[object "+r+"]"]=r,n},{}),p=Object.keys(h).reduce(function(n,r){return n[h[r].toUpperCase()]=r,n},{}),g={"[object Map]":!0,"[object Set]":!0},R={boolean:!0,function:!0,number:!0,string:!0,undefined:!0},d=((t={})[p.ARGUMENTS]=!0,t[p.ARRAY]=!0,t),b=((e={})[p.REGEXP]=!0,e[p.SYMBOL]=!0,e),v=((u={})[p.FLOAT32ARRAY]=!0,u[p.FLOAT64ARRAY]=!0,u[p.INT8ARRAY]=!0,u[p.INT16ARRAY]=!0,u[p.INT32ARRAY]=!0,u[p.UINT8ARRAY]=!0,u[p.UINT8CLAMPEDARRAY]=!0,u[p.UINT16ARRAY]=!0,u[p.UINT32ARRAY]=!0,u),E=((f={})[p.GENERATOR]=!0,f[p.PROMISE]=!0,f[p.WEAKMAP]=!0,f[p.WEAKSET]=!0,f),T=String.prototype.charCodeAt,m=Object.prototype.toString,S=Object.keys,N=function(){return"~"},M=function(n,r){return r<n},U=function(n,r){return M(n[0],r[0])},O=function(n,r){return n+"|"+r},j=function(n,r){for(var t,e,u=0;u<n.length;u++){for(e=n[u],t=u-1;~t&&r(n[t],e);t--)n[t+1]=n[t];n[t+1]=e}return n},I=l?function(n){return Buffer.from(n).toString("utf8")}:s?function(n){return String.fromCharCode.apply(null,new Uint16Array(n))}:function(){return""},Y=function(n,r){for(var t=0;t<n.length;t++)if(n[t]===r)return t;return-1},B=function(n,r){var t=typeof n;if("string"===t)return n;if(R[t])return O(t,n);if(null===n)return O("null",n);var e,u=m.call(n);return d[u]?n:u===p.OBJECT?~Y(r,n)?"~":(r.push(n),function(n){for(var r,t=j(S(n),M),e={},u=0;u<t.length;u++)e[r=t[u]]=n[r];return e}(n)):b[u]?O(h[u],n.toString()):g[u]?~Y(r,n)?"~":(r.push(n),function(n){var t="function"==typeof n.get,e=[];n.forEach(function(n,r){e.push(t?[P(r),P(n)]:[P(n)])}),j(e,U);for(var r,u,o=new Array(n.size),f=0;f<n.size;f++)r=e[f],o[f]=t?"["+r[0]+","+r[1]+"]":r[0];return O((u=n.constructor).name||(u.toString().match(/^\s*function\s*([^\(]*)/i)||[])[1]||"anonymous","["+o.join(",")+"]")}(n)):u===p.DATE?O(h[u],n.getTime()):u===p.ERROR?O(h[u],n.stack):u===p.EVENT?{bubbles:(e=n).bubbles,cancelBubble:e.cancelBubble,cancelable:e.cancelable,composed:e.composed,currentTarget:e.currentTarget,defaultPrevented:e.defaultPrevented,eventPhase:e.eventPhase,isTrusted:e.isTrusted,returnValue:e.returnValue,target:e.target,type:e.type}:E[u]?O(h[u],"NOT_ENUMERABLE"):A.test(u)||y.test(u)?O(u.slice(8,-1),n.outerHTML):u===p.DOCUMENTFRAGMENT?O(h[u],function(n){for(var r=n.children,t="",e=0;e<r.length;e++)t+=r[e].outerHTML;return t}(n)):v[u]?O(h[u],n.join(",")):u===p.ARRAYBUFFER?O(h[u],I(n)):u===p.DATAVIEW?O(h[u],I(n.buffer)):n},F=function(t){return function(n,r){return B(r,t)}};function P(n){return"object"==typeof n&&n&&!(n instanceof RegExp||n instanceof Date)?(r=n,t=F([]),e=null,u=N,JSON.stringify(r,i(t,u),e)):B(n);var r,t,e,u}var L=function(n){return function(n){for(var r,t=n.length,e=5381,u=52711;t--;)e=33*e^(r=T.call(n,t)),u=33*u^r;return 4096*(e>>>0)+(u>>>0)}(P(n))};(L.is=r(function(n,r){return L(n)===L(r)})).all=r(function(){for(var n=arguments.length,r=new Array(n),t=0;t<n;t++)r[t]=arguments[t];for(var e=L.is(r.shift()),u=0;u<r.length;u++)if(!e(r[u]))return!1;return!0},2),L.is.any=r(function(){for(var n=arguments.length,r=new Array(n),t=0;t<n;t++)r[t]=arguments[t];for(var e=L.is(r.shift()),u=0;u<r.length;u++)if(e(r[u]))return!0;return!1},2),L.is.not=r(function(n,r){return L(n)!==L(r)}),n.hash=L,n.default=L,Object.defineProperty(n,"__esModule",{value:!0})});

@@ -7,46 +7,43 @@ var _SELF_TAGS, _TOSTRING_TAGS, _TYPEDARRAY_TAGS, _UNPARSEABLE_TAGS;

export var CIRCULAR_VALUE = '~';
/**
* @constant {boolean} HAS_BUFFER_FROM_SUPPORT
*/
export var HAS_BUFFER_FROM_SUPPORT = typeof Buffer !== 'undefined' && typeof Buffer.from === 'function';
/**
* @constant {boolean} HAS_UINT16ARRAY_SUPPORT
*/
export var HAS_UINT16ARRAY_SUPPORT = typeof Uint16Array === 'function';
/**
* @constant {RegExp} HTML_ELEMENT_REGEXP
*/
export var HTML_ELEMENT_REGEXP = /\[object (HTML(.*)Element)\]/;
/**
* @constant {RegExp} SVG_ELEMENT_REGEXP
*/
export var SVG_ELEMENT_REGEXP = /\[object (SVG(.*)Element)\]/;
/**
* @constant {Array<string>} OBJECT_CLASSES
*/
export var OBJECT_CLASSES = ['Arguments', 'Array', 'ArrayBuffer', 'Boolean', 'DataView', 'Date', 'DocumentFragment', 'Error', 'Event', 'Float32Array', 'Float64Array', 'Function', 'Generator', 'GeneratorFunction', 'HTMLElement', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Null', 'Number', 'Object', 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'Undefined', 'WeakMap', 'WeakSet', 'Window'];
/**
* @constant {Object} OBJECT_CLASS_MAP
*/
export var OBJECT_CLASS_MAP = OBJECT_CLASSES.reduce(function (objectClasses, type) {
objectClasses['[object ' + type + ']'] = type;
objectClasses["[object " + type + "]"] = type;
return objectClasses;
}, {});
/**
* @constant {Object} OBJECT_CLASS_TYPE_MAP
*/
export var OBJECT_CLASS_TYPE_MAP = Object.keys(OBJECT_CLASS_MAP).reduce(function (objectClassTypes, objectClass) {
objectClassTypes[OBJECT_CLASS_MAP[objectClass].toUpperCase()] = objectClass;
return objectClassTypes;
}, {});
export var ITERABLE_TAGS = {

@@ -56,3 +53,2 @@ '[object Map]': true,

};
export var PRIMITIVE_TAGS = {

@@ -65,9 +61,5 @@ boolean: true,

};
export var SELF_TAGS = (_SELF_TAGS = {}, _SELF_TAGS[OBJECT_CLASS_TYPE_MAP.ARGUMENTS] = true, _SELF_TAGS[OBJECT_CLASS_TYPE_MAP.ARRAY] = true, _SELF_TAGS);
export var TOSTRING_TAGS = (_TOSTRING_TAGS = {}, _TOSTRING_TAGS[OBJECT_CLASS_TYPE_MAP.REGEXP] = true, _TOSTRING_TAGS[OBJECT_CLASS_TYPE_MAP.SYMBOL] = true, _TOSTRING_TAGS);
export var TYPEDARRAY_TAGS = (_TYPEDARRAY_TAGS = {}, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.FLOAT32ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.FLOAT64ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.INT8ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.INT16ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.INT32ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT8ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT8CLAMPEDARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT16ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT32ARRAY] = true, _TYPEDARRAY_TAGS);
export var UNPARSEABLE_TAGS = (_UNPARSEABLE_TAGS = {}, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.GENERATOR] = true, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.PROMISE] = true, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.WEAKMAP] = true, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.WEAKSET] = true, _UNPARSEABLE_TAGS);
// external dependencies
import { curry } from 'curriable';
import { curry } from 'curriable'; // utils
// utils
import { getIntegerHashValue, stringify } from './utils';
/**

@@ -16,6 +14,6 @@ * @function hash

*/
export var hash = function hash(value) {
return getIntegerHashValue(stringify(value));
};
/**

@@ -30,6 +28,6 @@ * @function hash.is

*/
hash.is = curry(function (object, otherObject) {
return hash(object) === hash(otherObject);
});
/**

@@ -44,4 +42,5 @@ * @function hash.is.all

*/
hash.is.all = curry(function () {
for (var _len = arguments.length, objects = Array(_len), _key = 0; _key < _len; _key++) {
for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {
objects[_key] = arguments[_key];

@@ -60,3 +59,2 @@ }

}, 2);
/**

@@ -71,4 +69,5 @@ * @function hash.is.any

*/
hash.is.any = curry(function () {
for (var _len2 = arguments.length, objects = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
for (var _len2 = arguments.length, objects = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
objects[_key2] = arguments[_key2];

@@ -87,3 +86,2 @@ }

}, 2);
/**

@@ -98,6 +96,6 @@ * @function hash.is.not

*/
hash.is.not = curry(function (object, otherObject) {
return hash(object) !== hash(otherObject);
});
export default hash;
// external dependencies
import fastStringify from 'fast-stringify';
import fastStringify from 'fast-stringify'; // constants
// constants
import { CIRCULAR_VALUE, HAS_BUFFER_FROM_SUPPORT, HAS_UINT16ARRAY_SUPPORT, HTML_ELEMENT_REGEXP, ITERABLE_TAGS, OBJECT_CLASS_MAP, OBJECT_CLASS_TYPE_MAP, PRIMITIVE_TAGS, SELF_TAGS, SVG_ELEMENT_REGEXP, TOSTRING_TAGS, TYPEDARRAY_TAGS, UNPARSEABLE_TAGS } from './constants';
var charCodeAt = String.prototype.charCodeAt;
var toString = Object.prototype.toString;
var keys = Object.keys;
/**

@@ -20,6 +17,6 @@ * @function getFunctionName

*/
export var getFunctionName = function getFunctionName(fn) {
return fn.name || (fn.toString().match(/^\s*function\s*([^\(]*)/i) || [])[1] || 'anonymous';
};
/**

@@ -33,6 +30,6 @@ * @function getCircularValue

*/
export var getCircularValue = function getCircularValue() {
return CIRCULAR_VALUE;
};
/**

@@ -49,2 +46,3 @@ * @function getIntegerHashValue

*/
export var getIntegerHashValue = function getIntegerHashValue(string) {

@@ -54,7 +52,6 @@ var index = string.length,

hashB = 52711,
charCode = void 0;
charCode;
while (index--) {
charCode = charCodeAt.call(string, index);
hashA = hashA * 33 ^ charCode;

@@ -66,3 +63,2 @@ hashB = hashB * 33 ^ charCode;

};
/**

@@ -87,2 +83,3 @@ * @function getSortedEvent

*/
export var getSortedEvent = function getSortedEvent(_ref) {

@@ -114,3 +111,2 @@ var bubbles = _ref.bubbles,

};
/**

@@ -126,6 +122,6 @@ * @function shouldSort

*/
export var shouldSort = function shouldSort(valueA, valueB) {
return valueA > valueB;
};
/**

@@ -141,6 +137,6 @@ * @function shouldSortPair

*/
export var shouldSortPair = function shouldSortPair(pairA, pairB) {
return shouldSort(pairA[0], pairB[0]);
};
/**

@@ -156,6 +152,6 @@ * @function getPrefixedValue

*/
export var getPrefixedValue = function getPrefixedValue(tag, value) {
return tag + '|' + value;
return tag + "|" + value;
};
/**

@@ -171,5 +167,5 @@ * @function sort

*/
export var sort = function sort(array, fn) {
var subIndex = void 0,
value = void 0;
var subIndex, value;

@@ -188,3 +184,2 @@ for (var index = 0; index < array.length; index++) {

};
/**

@@ -199,6 +194,6 @@ * @function getIterablePairs

*/
export var getSortedIterablePairs = function getSortedIterablePairs(iterable) {
var isMap = typeof iterable.get === 'function';
var pairs = [];
iterable.forEach(function (value, key) {

@@ -208,18 +203,13 @@ // eslint-disable-next-line no-use-before-define

});
sort(pairs, shouldSortPair);
var finalPairs = new Array(iterable.size);
var pair;
var pair = void 0;
for (var index = 0; index < iterable.size; index++) {
pair = pairs[index];
finalPairs[index] = isMap ? '[' + pair[0] + ',' + pair[1] + ']' : pair[0];
finalPairs[index] = isMap ? "[" + pair[0] + "," + pair[1] + "]" : pair[0];
}
return getPrefixedValue(getFunctionName(iterable.constructor), '[' + finalPairs.join(',') + ']');
return getPrefixedValue(getFunctionName(iterable.constructor), "[" + finalPairs.join(',') + "]");
};
/**

@@ -234,11 +224,10 @@ * @function getSortedObject

*/
export var getSortedObject = function getSortedObject(object) {
var objectKeys = sort(keys(object), shouldSort);
var newObject = {};
var key;
var key = void 0;
for (var index = 0; index < objectKeys.length; index++) {
key = objectKeys[index];
newObject[key] = object[key];

@@ -249,3 +238,2 @@ }

};
/**

@@ -260,6 +248,6 @@ * @function getStringifiedArrayBufferFallback

*/
export var getStringifiedArrayBufferFallback = function getStringifiedArrayBufferFallback(buffer) {
return String.fromCharCode.apply(null, new Uint16Array(buffer));
};
/**

@@ -274,6 +262,6 @@ * @function getStringifiedArrayBufferModern

*/
export var getStringifiedArrayBufferModern = function getStringifiedArrayBufferModern(buffer) {
return Buffer.from(buffer).toString('utf8');
};
/**

@@ -287,6 +275,6 @@ * @function getStringifiedArrayBufferNoSupport

*/
export var getStringifiedArrayBufferNoSupport = function getStringifiedArrayBufferNoSupport() {
return '';
};
/**

@@ -301,6 +289,6 @@ * @function getStringifiedArrayBuffer

*/
export var getStringifiedArrayBuffer = function () {
return HAS_BUFFER_FROM_SUPPORT ? getStringifiedArrayBufferModern : HAS_UINT16ARRAY_SUPPORT ? getStringifiedArrayBufferFallback : getStringifiedArrayBufferNoSupport;
}();
/**

@@ -315,5 +303,5 @@ * @function getStringifiedDocumentFragment

*/
export var getStringifiedDocumentFragment = function getStringifiedDocumentFragment(fragment) {
var children = fragment.children;
var innerHTML = '';

@@ -328,3 +316,2 @@

};
/**

@@ -340,2 +327,3 @@ * @function indexOf

*/
export var indexOf = function indexOf(array, value) {

@@ -350,3 +338,2 @@ for (var index = 0; index < array.length; index++) {

};
/**

@@ -362,2 +349,3 @@ * @function getNormalizedValue

*/
export var getNormalizedValue = function getNormalizedValue(value, sortedCache) {

@@ -390,3 +378,2 @@ var type = typeof value;

sortedCache.push(value);
return getSortedObject(value, sortedCache);

@@ -405,3 +392,2 @@ }

sortedCache.push(value);
return getSortedIterablePairs(value);

@@ -448,3 +434,2 @@ }

};
/**

@@ -459,2 +444,3 @@ * @function replacer

*/
export var createReplacer = function createReplacer(sortedCache) {

@@ -465,3 +451,2 @@ return function (key, value) {

};
/**

@@ -476,4 +461,5 @@ * @function stringify

*/
export function stringify(value) {
return typeof value === 'object' && value && !(value instanceof RegExp || value instanceof Date) ? fastStringify(value, createReplacer([]), null, getCircularValue) : getNormalizedValue(value);
}

@@ -1,4 +0,5 @@

'use strict';
"use strict";
exports.__esModule = true;
exports.UNPARSEABLE_TAGS = exports.TYPEDARRAY_TAGS = exports.TOSTRING_TAGS = exports.SELF_TAGS = exports.PRIMITIVE_TAGS = exports.ITERABLE_TAGS = exports.OBJECT_CLASS_TYPE_MAP = exports.OBJECT_CLASS_MAP = exports.OBJECT_CLASSES = exports.SVG_ELEMENT_REGEXP = exports.HTML_ELEMENT_REGEXP = exports.HAS_UINT16ARRAY_SUPPORT = exports.HAS_BUFFER_FROM_SUPPORT = exports.CIRCULAR_VALUE = void 0;

@@ -10,53 +11,58 @@ var _SELF_TAGS, _TOSTRING_TAGS, _TYPEDARRAY_TAGS, _UNPARSEABLE_TAGS;

*/
var CIRCULAR_VALUE = exports.CIRCULAR_VALUE = '~';
var CIRCULAR_VALUE = '~';
/**
* @constant {boolean} HAS_BUFFER_FROM_SUPPORT
*/
var HAS_BUFFER_FROM_SUPPORT = exports.HAS_BUFFER_FROM_SUPPORT = typeof Buffer !== 'undefined' && typeof Buffer.from === 'function';
exports.CIRCULAR_VALUE = CIRCULAR_VALUE;
var HAS_BUFFER_FROM_SUPPORT = typeof Buffer !== 'undefined' && typeof Buffer.from === 'function';
/**
* @constant {boolean} HAS_UINT16ARRAY_SUPPORT
*/
var HAS_UINT16ARRAY_SUPPORT = exports.HAS_UINT16ARRAY_SUPPORT = typeof Uint16Array === 'function';
exports.HAS_BUFFER_FROM_SUPPORT = HAS_BUFFER_FROM_SUPPORT;
var HAS_UINT16ARRAY_SUPPORT = typeof Uint16Array === 'function';
/**
* @constant {RegExp} HTML_ELEMENT_REGEXP
*/
var HTML_ELEMENT_REGEXP = exports.HTML_ELEMENT_REGEXP = /\[object (HTML(.*)Element)\]/;
exports.HAS_UINT16ARRAY_SUPPORT = HAS_UINT16ARRAY_SUPPORT;
var HTML_ELEMENT_REGEXP = /\[object (HTML(.*)Element)\]/;
/**
* @constant {RegExp} SVG_ELEMENT_REGEXP
*/
var SVG_ELEMENT_REGEXP = exports.SVG_ELEMENT_REGEXP = /\[object (SVG(.*)Element)\]/;
exports.HTML_ELEMENT_REGEXP = HTML_ELEMENT_REGEXP;
var SVG_ELEMENT_REGEXP = /\[object (SVG(.*)Element)\]/;
/**
* @constant {Array<string>} OBJECT_CLASSES
*/
var OBJECT_CLASSES = exports.OBJECT_CLASSES = ['Arguments', 'Array', 'ArrayBuffer', 'Boolean', 'DataView', 'Date', 'DocumentFragment', 'Error', 'Event', 'Float32Array', 'Float64Array', 'Function', 'Generator', 'GeneratorFunction', 'HTMLElement', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Null', 'Number', 'Object', 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'Undefined', 'WeakMap', 'WeakSet', 'Window'];
exports.SVG_ELEMENT_REGEXP = SVG_ELEMENT_REGEXP;
var OBJECT_CLASSES = ['Arguments', 'Array', 'ArrayBuffer', 'Boolean', 'DataView', 'Date', 'DocumentFragment', 'Error', 'Event', 'Float32Array', 'Float64Array', 'Function', 'Generator', 'GeneratorFunction', 'HTMLElement', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Null', 'Number', 'Object', 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'Undefined', 'WeakMap', 'WeakSet', 'Window'];
/**
* @constant {Object} OBJECT_CLASS_MAP
*/
var OBJECT_CLASS_MAP = exports.OBJECT_CLASS_MAP = OBJECT_CLASSES.reduce(function (objectClasses, type) {
objectClasses['[object ' + type + ']'] = type;
exports.OBJECT_CLASSES = OBJECT_CLASSES;
var OBJECT_CLASS_MAP = OBJECT_CLASSES.reduce(function (objectClasses, type) {
objectClasses["[object " + type + "]"] = type;
return objectClasses;
}, {});
/**
* @constant {Object} OBJECT_CLASS_TYPE_MAP
*/
var OBJECT_CLASS_TYPE_MAP = exports.OBJECT_CLASS_TYPE_MAP = Object.keys(OBJECT_CLASS_MAP).reduce(function (objectClassTypes, objectClass) {
exports.OBJECT_CLASS_MAP = OBJECT_CLASS_MAP;
var OBJECT_CLASS_TYPE_MAP = Object.keys(OBJECT_CLASS_MAP).reduce(function (objectClassTypes, objectClass) {
objectClassTypes[OBJECT_CLASS_MAP[objectClass].toUpperCase()] = objectClass;
return objectClassTypes;
}, {});
var ITERABLE_TAGS = exports.ITERABLE_TAGS = {
exports.OBJECT_CLASS_TYPE_MAP = OBJECT_CLASS_TYPE_MAP;
var ITERABLE_TAGS = {
'[object Map]': true,
'[object Set]': true
};
var PRIMITIVE_TAGS = exports.PRIMITIVE_TAGS = {
exports.ITERABLE_TAGS = ITERABLE_TAGS;
var PRIMITIVE_TAGS = {
boolean: true,

@@ -68,9 +74,10 @@ function: true,

};
var SELF_TAGS = exports.SELF_TAGS = (_SELF_TAGS = {}, _SELF_TAGS[OBJECT_CLASS_TYPE_MAP.ARGUMENTS] = true, _SELF_TAGS[OBJECT_CLASS_TYPE_MAP.ARRAY] = true, _SELF_TAGS);
var TOSTRING_TAGS = exports.TOSTRING_TAGS = (_TOSTRING_TAGS = {}, _TOSTRING_TAGS[OBJECT_CLASS_TYPE_MAP.REGEXP] = true, _TOSTRING_TAGS[OBJECT_CLASS_TYPE_MAP.SYMBOL] = true, _TOSTRING_TAGS);
var TYPEDARRAY_TAGS = exports.TYPEDARRAY_TAGS = (_TYPEDARRAY_TAGS = {}, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.FLOAT32ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.FLOAT64ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.INT8ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.INT16ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.INT32ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT8ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT8CLAMPEDARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT16ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT32ARRAY] = true, _TYPEDARRAY_TAGS);
var UNPARSEABLE_TAGS = exports.UNPARSEABLE_TAGS = (_UNPARSEABLE_TAGS = {}, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.GENERATOR] = true, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.PROMISE] = true, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.WEAKMAP] = true, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.WEAKSET] = true, _UNPARSEABLE_TAGS);
exports.PRIMITIVE_TAGS = PRIMITIVE_TAGS;
var SELF_TAGS = (_SELF_TAGS = {}, _SELF_TAGS[OBJECT_CLASS_TYPE_MAP.ARGUMENTS] = true, _SELF_TAGS[OBJECT_CLASS_TYPE_MAP.ARRAY] = true, _SELF_TAGS);
exports.SELF_TAGS = SELF_TAGS;
var TOSTRING_TAGS = (_TOSTRING_TAGS = {}, _TOSTRING_TAGS[OBJECT_CLASS_TYPE_MAP.REGEXP] = true, _TOSTRING_TAGS[OBJECT_CLASS_TYPE_MAP.SYMBOL] = true, _TOSTRING_TAGS);
exports.TOSTRING_TAGS = TOSTRING_TAGS;
var TYPEDARRAY_TAGS = (_TYPEDARRAY_TAGS = {}, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.FLOAT32ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.FLOAT64ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.INT8ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.INT16ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.INT32ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT8ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT8CLAMPEDARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT16ARRAY] = true, _TYPEDARRAY_TAGS[OBJECT_CLASS_TYPE_MAP.UINT32ARRAY] = true, _TYPEDARRAY_TAGS);
exports.TYPEDARRAY_TAGS = TYPEDARRAY_TAGS;
var UNPARSEABLE_TAGS = (_UNPARSEABLE_TAGS = {}, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.GENERATOR] = true, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.PROMISE] = true, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.WEAKMAP] = true, _UNPARSEABLE_TAGS[OBJECT_CLASS_TYPE_MAP.WEAKSET] = true, _UNPARSEABLE_TAGS);
exports.UNPARSEABLE_TAGS = UNPARSEABLE_TAGS;

@@ -1,10 +0,13 @@

'use strict';
"use strict";
exports.__esModule = true;
exports.hash = undefined;
exports.default = exports.hash = void 0;
var _curriable = require('curriable');
var _curriable = require("curriable");
var _utils = require('./utils');
var _utils = require("./utils");
// external dependencies
// utils
/**

@@ -19,7 +22,5 @@ * @function hash

*/
// external dependencies
var hash = exports.hash = function hash(value) {
var hash = function hash(value) {
return (0, _utils.getIntegerHashValue)((0, _utils.stringify)(value));
};
/**

@@ -36,7 +37,6 @@ * @function hash.is

// utils
exports.hash = hash;
hash.is = (0, _curriable.curry)(function (object, otherObject) {
return hash(object) === hash(otherObject);
});
/**

@@ -51,4 +51,5 @@ * @function hash.is.all

*/
hash.is.all = (0, _curriable.curry)(function () {
for (var _len = arguments.length, objects = Array(_len), _key = 0; _key < _len; _key++) {
for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {
objects[_key] = arguments[_key];

@@ -67,3 +68,2 @@ }

}, 2);
/**

@@ -78,4 +78,5 @@ * @function hash.is.any

*/
hash.is.any = (0, _curriable.curry)(function () {
for (var _len2 = arguments.length, objects = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
for (var _len2 = arguments.length, objects = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
objects[_key2] = arguments[_key2];

@@ -94,3 +95,2 @@ }

}, 2);
/**

@@ -105,6 +105,7 @@ * @function hash.is.not

*/
hash.is.not = (0, _curriable.curry)(function (object, otherObject) {
return hash(object) !== hash(otherObject);
});
exports.default = hash;
var _default = hash;
exports.default = _default;

@@ -1,23 +0,18 @@

'use strict';
"use strict";
exports.__esModule = true;
exports.createReplacer = exports.getNormalizedValue = exports.indexOf = exports.getStringifiedDocumentFragment = exports.getStringifiedArrayBuffer = exports.getStringifiedArrayBufferNoSupport = exports.getStringifiedArrayBufferModern = exports.getStringifiedArrayBufferFallback = exports.getSortedObject = exports.getSortedIterablePairs = exports.sort = exports.getPrefixedValue = exports.shouldSortPair = exports.shouldSort = exports.getSortedEvent = exports.getIntegerHashValue = exports.getCircularValue = exports.getFunctionName = undefined;
exports.stringify = stringify;
exports.createReplacer = exports.getNormalizedValue = exports.indexOf = exports.getStringifiedDocumentFragment = exports.getStringifiedArrayBuffer = exports.getStringifiedArrayBufferNoSupport = exports.getStringifiedArrayBufferModern = exports.getStringifiedArrayBufferFallback = exports.getSortedObject = exports.getSortedIterablePairs = exports.sort = exports.getPrefixedValue = exports.shouldSortPair = exports.shouldSort = exports.getSortedEvent = exports.getIntegerHashValue = exports.getCircularValue = exports.getFunctionName = void 0;
var _fastStringify = require('fast-stringify');
var _fastStringify = _interopRequireDefault(require("fast-stringify"));
var _fastStringify2 = _interopRequireDefault(_fastStringify);
var _constants = require("./constants");
var _constants = require('./constants');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// external dependencies
// constants
var charCodeAt = String.prototype.charCodeAt;
// constants
var toString = Object.prototype.toString;
var keys = Object.keys;
/**

@@ -32,6 +27,6 @@ * @function getFunctionName

*/
var getFunctionName = exports.getFunctionName = function getFunctionName(fn) {
var getFunctionName = function getFunctionName(fn) {
return fn.name || (fn.toString().match(/^\s*function\s*([^\(]*)/i) || [])[1] || 'anonymous';
};
/**

@@ -45,6 +40,9 @@ * @function getCircularValue

*/
var getCircularValue = exports.getCircularValue = function getCircularValue() {
exports.getFunctionName = getFunctionName;
var getCircularValue = function getCircularValue() {
return _constants.CIRCULAR_VALUE;
};
/**

@@ -61,11 +59,14 @@ * @function getIntegerHashValue

*/
var getIntegerHashValue = exports.getIntegerHashValue = function getIntegerHashValue(string) {
exports.getCircularValue = getCircularValue;
var getIntegerHashValue = function getIntegerHashValue(string) {
var index = string.length,
hashA = 5381,
hashB = 52711,
charCode = void 0;
charCode;
while (index--) {
charCode = charCodeAt.call(string, index);
hashA = hashA * 33 ^ charCode;

@@ -77,3 +78,2 @@ hashB = hashB * 33 ^ charCode;

};
/**

@@ -98,3 +98,7 @@ * @function getSortedEvent

*/
var getSortedEvent = exports.getSortedEvent = function getSortedEvent(_ref) {
exports.getIntegerHashValue = getIntegerHashValue;
var getSortedEvent = function getSortedEvent(_ref) {
var bubbles = _ref.bubbles,

@@ -125,3 +129,2 @@ cancelBubble = _ref.cancelBubble,

};
/**

@@ -137,6 +140,9 @@ * @function shouldSort

*/
var shouldSort = exports.shouldSort = function shouldSort(valueA, valueB) {
exports.getSortedEvent = getSortedEvent;
var shouldSort = function shouldSort(valueA, valueB) {
return valueA > valueB;
};
/**

@@ -152,6 +158,9 @@ * @function shouldSortPair

*/
var shouldSortPair = exports.shouldSortPair = function shouldSortPair(pairA, pairB) {
exports.shouldSort = shouldSort;
var shouldSortPair = function shouldSortPair(pairA, pairB) {
return shouldSort(pairA[0], pairB[0]);
};
/**

@@ -167,6 +176,9 @@ * @function getPrefixedValue

*/
var getPrefixedValue = exports.getPrefixedValue = function getPrefixedValue(tag, value) {
return tag + '|' + value;
exports.shouldSortPair = shouldSortPair;
var getPrefixedValue = function getPrefixedValue(tag, value) {
return tag + "|" + value;
};
/**

@@ -182,6 +194,9 @@ * @function sort

*/
var sort = exports.sort = function sort(array, fn) {
var subIndex = void 0,
value = void 0;
exports.getPrefixedValue = getPrefixedValue;
var sort = function sort(array, fn) {
var subIndex, value;
for (var index = 0; index < array.length; index++) {

@@ -199,3 +214,2 @@ value = array[index];

};
/**

@@ -210,6 +224,9 @@ * @function getIterablePairs

*/
var getSortedIterablePairs = exports.getSortedIterablePairs = function getSortedIterablePairs(iterable) {
exports.sort = sort;
var getSortedIterablePairs = function getSortedIterablePairs(iterable) {
var isMap = typeof iterable.get === 'function';
var pairs = [];
iterable.forEach(function (value, key) {

@@ -219,18 +236,13 @@ // eslint-disable-next-line no-use-before-define

});
sort(pairs, shouldSortPair);
var finalPairs = new Array(iterable.size);
var pair;
var pair = void 0;
for (var index = 0; index < iterable.size; index++) {
pair = pairs[index];
finalPairs[index] = isMap ? '[' + pair[0] + ',' + pair[1] + ']' : pair[0];
finalPairs[index] = isMap ? "[" + pair[0] + "," + pair[1] + "]" : pair[0];
}
return getPrefixedValue(getFunctionName(iterable.constructor), '[' + finalPairs.join(',') + ']');
return getPrefixedValue(getFunctionName(iterable.constructor), "[" + finalPairs.join(',') + "]");
};
/**

@@ -245,11 +257,13 @@ * @function getSortedObject

*/
var getSortedObject = exports.getSortedObject = function getSortedObject(object) {
exports.getSortedIterablePairs = getSortedIterablePairs;
var getSortedObject = function getSortedObject(object) {
var objectKeys = sort(keys(object), shouldSort);
var newObject = {};
var key;
var key = void 0;
for (var index = 0; index < objectKeys.length; index++) {
key = objectKeys[index];
newObject[key] = object[key];

@@ -260,3 +274,2 @@ }

};
/**

@@ -271,6 +284,9 @@ * @function getStringifiedArrayBufferFallback

*/
var getStringifiedArrayBufferFallback = exports.getStringifiedArrayBufferFallback = function getStringifiedArrayBufferFallback(buffer) {
exports.getSortedObject = getSortedObject;
var getStringifiedArrayBufferFallback = function getStringifiedArrayBufferFallback(buffer) {
return String.fromCharCode.apply(null, new Uint16Array(buffer));
};
/**

@@ -285,6 +301,9 @@ * @function getStringifiedArrayBufferModern

*/
var getStringifiedArrayBufferModern = exports.getStringifiedArrayBufferModern = function getStringifiedArrayBufferModern(buffer) {
exports.getStringifiedArrayBufferFallback = getStringifiedArrayBufferFallback;
var getStringifiedArrayBufferModern = function getStringifiedArrayBufferModern(buffer) {
return Buffer.from(buffer).toString('utf8');
};
/**

@@ -298,6 +317,9 @@ * @function getStringifiedArrayBufferNoSupport

*/
var getStringifiedArrayBufferNoSupport = exports.getStringifiedArrayBufferNoSupport = function getStringifiedArrayBufferNoSupport() {
exports.getStringifiedArrayBufferModern = getStringifiedArrayBufferModern;
var getStringifiedArrayBufferNoSupport = function getStringifiedArrayBufferNoSupport() {
return '';
};
/**

@@ -312,6 +334,9 @@ * @function getStringifiedArrayBuffer

*/
var getStringifiedArrayBuffer = exports.getStringifiedArrayBuffer = function () {
exports.getStringifiedArrayBufferNoSupport = getStringifiedArrayBufferNoSupport;
var getStringifiedArrayBuffer = function () {
return _constants.HAS_BUFFER_FROM_SUPPORT ? getStringifiedArrayBufferModern : _constants.HAS_UINT16ARRAY_SUPPORT ? getStringifiedArrayBufferFallback : getStringifiedArrayBufferNoSupport;
}();
/**

@@ -326,5 +351,8 @@ * @function getStringifiedDocumentFragment

*/
var getStringifiedDocumentFragment = exports.getStringifiedDocumentFragment = function getStringifiedDocumentFragment(fragment) {
exports.getStringifiedArrayBuffer = getStringifiedArrayBuffer;
var getStringifiedDocumentFragment = function getStringifiedDocumentFragment(fragment) {
var children = fragment.children;
var innerHTML = '';

@@ -339,3 +367,2 @@

};
/**

@@ -351,3 +378,7 @@ * @function indexOf

*/
var indexOf = exports.indexOf = function indexOf(array, value) {
exports.getStringifiedDocumentFragment = getStringifiedDocumentFragment;
var indexOf = function indexOf(array, value) {
for (var index = 0; index < array.length; index++) {

@@ -361,3 +392,2 @@ if (array[index] === value) {

};
/**

@@ -373,3 +403,7 @@ * @function getNormalizedValue

*/
var getNormalizedValue = exports.getNormalizedValue = function getNormalizedValue(value, sortedCache) {
exports.indexOf = indexOf;
var getNormalizedValue = function getNormalizedValue(value, sortedCache) {
var type = typeof value;

@@ -401,3 +435,2 @@

sortedCache.push(value);
return getSortedObject(value, sortedCache);

@@ -416,3 +449,2 @@ }

sortedCache.push(value);
return getSortedIterablePairs(value);

@@ -459,3 +491,2 @@ }

};
/**

@@ -470,3 +501,7 @@ * @function replacer

*/
var createReplacer = exports.createReplacer = function createReplacer(sortedCache) {
exports.getNormalizedValue = getNormalizedValue;
var createReplacer = function createReplacer(sortedCache) {
return function (key, value) {

@@ -476,3 +511,2 @@ return getNormalizedValue(value, sortedCache);

};
/**

@@ -487,4 +521,8 @@ * @function stringify

*/
exports.createReplacer = createReplacer;
function stringify(value) {
return typeof value === 'object' && value && !(value instanceof RegExp || value instanceof Date) ? (0, _fastStringify2.default)(value, createReplacer([]), null, getCircularValue) : getNormalizedValue(value);
return typeof value === 'object' && value && !(value instanceof RegExp || value instanceof Date) ? (0, _fastStringify.default)(value, createReplacer([]), null, getCircularValue) : getNormalizedValue(value);
}
{
"author": "planttheidea",
"ava": {
"babel": {
"babelrc": true,
"presets": [
"react"
]
},
"failFast": true,

@@ -16,3 +10,3 @@ "files": [

"require": [
"babel-register",
"@babel/register",
"./test/helpers/setup-browser-env.js"

@@ -35,17 +29,17 @@ ],

"devDependencies": {
"ava": "^0.25.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.3",
"babel-loader": "^7.1.4",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "6.24.1",
"babel-preset-stage-2": "^6.24.1",
"babel-register": "^6.26.0",
"babel-runtime": "^6.26.0",
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@babel/register": "^7.0.0",
"@babel/runtime": "^7.0.0",
"ava": "^1.0.0-rc.1",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.0",
"benchmark": "^2.1.4",
"browser-env": "^3.2.5",
"eslint": "^5.6.1",
"eslint": "^5.7.0",
"eslint-config-rapid7": "^3.1.0",

@@ -59,3 +53,3 @@ "eslint-friendly-formatter": "4.0.1",

"node-object-hash": "^1.4.1",
"nyc": "^13.0.1",
"nyc": "^13.1.0",
"object-hash": "^1.3.0",

@@ -66,7 +60,7 @@ "optimize-js-plugin": "^0.0.4",

"rimraf": "^2.6.2",
"rollup": "^0.66.5",
"rollup-plugin-babel": "^3.0.7",
"rollup": "^0.66.6",
"rollup-plugin-babel": "^4.0.1",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-uglify": "^6.0.0",
"sinon": "6.3.5",
"sinon": "7.0.0",
"uuid": "^3.3.2",

@@ -124,8 +118,8 @@ "webpack": "^4.20.2",

},
"version": "4.0.2",
"version": "4.0.3",
"dependencies": {
"curriable": "^1.1.0",
"fast-stringify": "^1.0.4",
"fast-stringify": "^1.1.1",
"json-prune": "^1.1.0"
}
}

@@ -219,4 +219,4 @@ # hash-it

console.log(isNull(123)); // true
console.log(isNull(null)); // flse
console.log(isNotNull(123)); // true
console.log(isNotNull(null)); // flse
```

@@ -223,0 +223,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc