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 3.1.1 to 3.1.2

benchmarks/compare.js

4

CHANGELOG.md
# hashIt CHANGELOG
## 3.1.2
* Remove extraneous `toString` call (performance)
## 3.1.1

@@ -4,0 +8,0 @@

20

dist/hash-it.js

@@ -295,6 +295,7 @@ (function webpackUniversalModuleDefinition(root, factory) {

* @param {*} object the object to get the stringification value for
* @param {string} [passedObjectClass] the object class for the object passed
* @returns {*} the value to stringify with
*/
var getStringifiedValueByObjectClass = function getStringifiedValueByObjectClass(object) {
var objectClass = toString.call(object);
var getStringifiedValueByObjectClass = function getStringifiedValueByObjectClass(object, passedObjectClass) {
var objectClass = passedObjectClass || toString.call(object);

@@ -409,3 +410,2 @@ if (~__WEBPACK_IMPORTED_MODULE_1__constants__["m" /* STRINGIFY_SELF_CLASSES */].indexOf(objectClass)) {

var circularCounter = 1,
type = void 0,
objectClass = void 0;

@@ -421,8 +421,6 @@

if (value === null) {
return getStringifiedValueByObjectClass(value);
return getStringifiedValueByObjectClass(value, __WEBPACK_IMPORTED_MODULE_1__constants__["d" /* OBJECT_CLASS_TYPE_MAP */].NULL);
}
type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
if (~__WEBPACK_IMPORTED_MODULE_1__constants__["p" /* STRINGIFY_TYPEOF_TYPES */].indexOf(type)) {
if (~__WEBPACK_IMPORTED_MODULE_1__constants__["p" /* STRINGIFY_TYPEOF_TYPES */].indexOf(typeof value === 'undefined' ? 'undefined' : _typeof(value))) {
return getValueForStringification(value);

@@ -438,3 +436,3 @@ }

if (~__WEBPACK_IMPORTED_MODULE_1__constants__["g" /* REPLACE_STRINGIFICATION_CLASSES */].indexOf(objectClass)) {
return getStringifiedValueByObjectClass(value);
return getStringifiedValueByObjectClass(value, objectClass);
}

@@ -717,6 +715,6 @@

*/
var OBJECT_CLASS_TYPE_MAP = OBJECT_CLASSES.reduce(function (objectClasses, type) {
objectClasses[type.toUpperCase()] = '[object ' + type + ']';
var OBJECT_CLASS_TYPE_MAP = Object.keys(OBJECT_CLASS_MAP).reduce(function (objectClassTypes, objectClass) {
objectClassTypes[OBJECT_CLASS_MAP[objectClass].toUpperCase()] = objectClass;
return objectClasses;
return objectClassTypes;
}, {});

@@ -723,0 +721,0 @@

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

!(function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("hashIt",[],n):"object"==typeof exports?exports.hashIt=n():t.hashIt=n()})("undefined"!=typeof self?self:this,(function(){return (function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r={};return n.m=t,n.c=r,n.d=function(t,r,e){n.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:e})},n.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(r,"a",r),r},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=0)})([function(t,n,r){t.exports=r(1)},function(t,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var e,o=r(2),u=r.n(o),i=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t},f=["Arguments","Array","ArrayBuffer","Boolean","DataView","Date","Error","Float32Array","Float64Array","Function","Generator","GeneratorFunction","HTMLElement","Int8Array","Int16Array","Int32Array","Map","Math","Null","Number","Object","Promise","RegExp","Set","String","Symbol","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","Undefined","WeakMap","WeakSet"],a=f.reduce((function(t,n){return t["[object "+n+"]"]=n,t}),{}),c=f.reduce((function(t,n){return t[n.toUpperCase()]="[object "+n+"]",t}),{}),l=[c.ARRAY,c.OBJECT],A=[c.DATE,c.MAP,c.SET,c.REGEXP,c.ERROR,c.GENERATORFUNCTION,c.MATH,c.ARRAYBUFFER,c.DATAVIEW,c.FLOAT32ARRAY,c.FLOAT64ARRAY,c.INT8ARRAY,c.INT16ARRAY,c.INT32ARRAY,c.UINT8ARRAY,c.UINT8CLAMPEDARRAY,c.UINT16ARRAY,c.UINT32ARRAY,c.PROMISE,c.GENERATOR,c.WEAKMAP,c.WEAKSET],p=[c.ARRAY,c.OBJECT,c.ARGUMENTS],s=[c.ERROR,c.REGEXP],d=[c.MAP,c.SET],y=[c.PROMISE,c.GENERATOR,c.WEAKMAP,c.WEAKSET],R=[c.FLOAT32ARRAY,c.FLOAT64ARRAY,c.INT8ARRAY,c.INT16ARRAY,c.INT32ARRAY,c.UINT8ARRAY,c.UINT8CLAMPEDARRAY,c.UINT16ARRAY,c.UINT32ARRAY],O=["string","number"],E=["boolean","undefined","function","symbol"],b=["symbol","function"],T=[].concat(O,E),v=/\[object (HTML(.*)Element)\]/,h=["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"].reduce((function(t,n){var r;return i({},t,(r={},r[n]=Math[n],r))}),{}),N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S=Object.prototype.toString,g=function(t,n){var r=[a[n]];return t.forEach((function(t,n){r.push([n,t])})),r},x=function(t){return"undefined"==typeof Uint16Array?"":String.fromCharCode.apply(null,new Uint16Array(t))},m=function(t,n){return a[n]+" "+t},I=function(t){for(var n=t.attributes,r="",e=0;e<n.length;e++)r+=n[e].name+'="'+n[e].value+'",';return t.tagName+" "+r+" "+t.innerHTML},j=function(t){var n=S.call(t);return~p.indexOf(n)?t:~s.indexOf(n)||null===t?m(t,n):n===c.DATE?m(t.valueOf(),n):~d.indexOf(n)?g(t,n):~y.indexOf(n)?m("NOT_ENUMERABLE",n):n===c.ARRAYBUFFER?m(x(t),n):n===c.DATAVIEW?m(x(t.buffer),n):~R.indexOf(n)?m(t.join(","),n):n===c.MATH?h:v.test(n)?m(I(t),c.HTMLELEMENT):t},M=function(t){var n=void 0===t?"undefined":N(t);return~O.indexOf(n)?t:~E.indexOf(n)?m(~b.indexOf(n)?t.constructor.prototype.toString.call(t):t,S.call(t)):j(t)},P=function(t,n,r,e){if(!t)return m(t,n);if(e>512)return r.length=0,t;var o=r.indexOf(t);return~o?"*Circular-"+o:(r.push(t),t)},U=function(t){var n=1,r=void 0,e=void 0;return function(o,u){return o?null===u?j(u):(r=void 0===u?"undefined":N(u),~T.indexOf(r)?M(u):(e=S.call(u),~l.indexOf(e)?P(u,e,t,++n):~A.indexOf(e)?j(u):u)):(t=[u],u)}},Y=function(t){if(!t)return 0;for(var n=5381,r=0;r<t.length;r++)n=(n<<5)+n+t.charCodeAt(r);return n>>>0},L=function(t){try{return JSON.stringify(t,U([]))}catch(n){return u()(t)}},F=function(t,n){var r=M(t);return"string"==typeof r?r:n?L(M(t)):JSON.stringify(r,U([]))},w=function(t,n){var r=F(t,n);return Y(r)},C=w(void 0),D=w(null),G=w([]),J=w(new Map),W=w(0),B=w({}),H=w(new Set),_=w(""),K=(e={},e[G]=!0,e[J]=!0,e[W]=!0,e[B]=!0,e[H]=!0,e[_]=!0,e[D]=!0,e[C]=!0,e);w.isEqual=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];var e=n.length;if(1===e)throw new Error("isEqual requires at least two objects to be passed for comparison.");for(var o=1;o<e;o++)if(w(n[o-1])!==w(n[o]))return!1;return!0},w.isEmpty=function(t){return!!K[w(t)]},w.isNull=function(t){return w(t)===D},w.isUndefined=function(t){return w(t)===C};n.default=w},function(t,n,r){!(function(){"use strict";function n(t){return f.lastIndex=0,f.test(t)?'"'+t.replace(f,(function(t){var n=a[t];return"string"==typeof n?n:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+t+'"'}var r,e,o=function(t,n){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n(r)},u=function(t,n){for(var r in t)n(r)},i=function(t,n,r){null!=t&&(r=r||{},Object.getOwnPropertyNames(t).forEach((function(t){r[t]||(n(t),r[t]=!0)})),i(Object.getPrototypeOf(t),n,r))};Object.defineProperty(Date.prototype,"toPrunedJSON",{value:Date.prototype.toJSON});var f=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c=function(t,f,a){function c(t,o,u){var i,f,p,s,d=o[t];switch(d&&"object"==typeof d&&"function"==typeof d.toPrunedJSON&&(d=d.toPrunedJSON(t)),d&&"function"==typeof d.toJSON&&(d=d.toJSON()),typeof d){case"string":return n(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(u<=0||-1!==r.indexOf(d)){if(l){var y=l(d,A,!0);return void 0===y?void 0:""+y}return A}if(r.push(d),s=[],"[object Array]"===Object.prototype.toString.apply(d)){for(p=Math.min(d.length,a),i=0;i<p;i+=1)s[i]=c(i,d,u-1)||"null";return f="["+s.join(",")+"]",l&&d.length>a?l(d,f,!1):f}return e(d,(function(t){try{f=c(t,d,u-1),f&&s.push(n(t)+":"+f)}catch(t){}})),"{"+s.join(",")+"}";case"function":case"undefined":return l?l(d,void 0,!1):void 0}}var l,A='"-pruned-"';if("object"==typeof f){var p=f;f=p.depthDecr,a=p.arrayMaxLength,e=p.iterator||o,p.allProperties?e=i:p.inheritedProperties&&(e=u),"prunedString"in p&&(A=p.prunedString),p.replacer&&(l=p.replacer)}else e=o;return r=[],f=f||6,a=a||50,c("",{"":t},f)};c.log=function(){},c.forEachProperty=i,t.exports=c})()}])}));
!(function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("hashIt",[],n):"object"==typeof exports?exports.hashIt=n():t.hashIt=n()})("undefined"!=typeof self?self:this,(function(){return (function(t){function n(e){if(r[e])return r[e].exports;var o=r[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r={};return n.m=t,n.c=r,n.d=function(t,r,e){n.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:e})},n.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(r,"a",r),r},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=0)})([function(t,n,r){t.exports=r(1)},function(t,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var e,o=r(2),u=r.n(o),i=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])}return t},f=["Arguments","Array","ArrayBuffer","Boolean","DataView","Date","Error","Float32Array","Float64Array","Function","Generator","GeneratorFunction","HTMLElement","Int8Array","Int16Array","Int32Array","Map","Math","Null","Number","Object","Promise","RegExp","Set","String","Symbol","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","Undefined","WeakMap","WeakSet"],a=f.reduce((function(t,n){return t["[object "+n+"]"]=n,t}),{}),c=Object.keys(a).reduce((function(t,n){return t[a[n].toUpperCase()]=n,t}),{}),l=[c.ARRAY,c.OBJECT],A=[c.DATE,c.MAP,c.SET,c.REGEXP,c.ERROR,c.GENERATORFUNCTION,c.MATH,c.ARRAYBUFFER,c.DATAVIEW,c.FLOAT32ARRAY,c.FLOAT64ARRAY,c.INT8ARRAY,c.INT16ARRAY,c.INT32ARRAY,c.UINT8ARRAY,c.UINT8CLAMPEDARRAY,c.UINT16ARRAY,c.UINT32ARRAY,c.PROMISE,c.GENERATOR,c.WEAKMAP,c.WEAKSET],p=[c.ARRAY,c.OBJECT,c.ARGUMENTS],s=[c.ERROR,c.REGEXP],d=[c.MAP,c.SET],y=[c.PROMISE,c.GENERATOR,c.WEAKMAP,c.WEAKSET],R=[c.FLOAT32ARRAY,c.FLOAT64ARRAY,c.INT8ARRAY,c.INT16ARRAY,c.INT32ARRAY,c.UINT8ARRAY,c.UINT8CLAMPEDARRAY,c.UINT16ARRAY,c.UINT32ARRAY],O=["string","number"],E=["boolean","undefined","function","symbol"],b=["symbol","function"],T=[].concat(O,E),v=/\[object (HTML(.*)Element)\]/,N=["E","LN2","LN10","LOG2E","LOG10E","PI","SQRT1_2","SQRT2"].reduce((function(t,n){var r;return i({},t,(r={},r[n]=Math[n],r))}),{}),h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S=Object.prototype.toString,g=function(t,n){var r=[a[n]];return t.forEach((function(t,n){r.push([n,t])})),r},x=function(t){return"undefined"==typeof Uint16Array?"":String.fromCharCode.apply(null,new Uint16Array(t))},m=function(t,n){return a[n]+" "+t},I=function(t){for(var n=t.attributes,r="",e=0;e<n.length;e++)r+=n[e].name+'="'+n[e].value+'",';return t.tagName+" "+r+" "+t.innerHTML},j=function(t,n){var r=n||S.call(t);return~p.indexOf(r)?t:~s.indexOf(r)||null===t?m(t,r):r===c.DATE?m(t.valueOf(),r):~d.indexOf(r)?g(t,r):~y.indexOf(r)?m("NOT_ENUMERABLE",r):r===c.ARRAYBUFFER?m(x(t),r):r===c.DATAVIEW?m(x(t.buffer),r):~R.indexOf(r)?m(t.join(","),r):r===c.MATH?N:v.test(r)?m(I(t),c.HTMLELEMENT):t},M=function(t){var n=void 0===t?"undefined":h(t);return~O.indexOf(n)?t:~E.indexOf(n)?m(~b.indexOf(n)?t.constructor.prototype.toString.call(t):t,S.call(t)):j(t)},P=function(t,n,r,e){if(!t)return m(t,n);if(e>512)return r.length=0,t;var o=r.indexOf(t);return~o?"*Circular-"+o:(r.push(t),t)},U=function(t){var n=1,r=void 0;return function(e,o){return e?null===o?j(o,c.NULL):~T.indexOf(void 0===o?"undefined":h(o))?M(o):(r=S.call(o),~l.indexOf(r)?P(o,r,t,++n):~A.indexOf(r)?j(o,r):o):(t=[o],o)}},Y=function(t){if(!t)return 0;for(var n=5381,r=0;r<t.length;r++)n=(n<<5)+n+t.charCodeAt(r);return n>>>0},L=function(t){try{return JSON.stringify(t,U([]))}catch(n){return u()(t)}},F=function(t,n){var r=M(t);return"string"==typeof r?r:n?L(M(t)):JSON.stringify(r,U([]))},w=function(t,n){var r=F(t,n);return Y(r)},C=w(void 0),D=w(null),G=w([]),J=w(new Map),W=w(0),B=w({}),H=w(new Set),_=w(""),K=(e={},e[G]=!0,e[J]=!0,e[W]=!0,e[B]=!0,e[H]=!0,e[_]=!0,e[D]=!0,e[C]=!0,e);w.isEqual=function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];var e=n.length;if(1===e)throw new Error("isEqual requires at least two objects to be passed for comparison.");for(var o=1;o<e;o++)if(w(n[o-1])!==w(n[o]))return!1;return!0},w.isEmpty=function(t){return!!K[w(t)]},w.isNull=function(t){return w(t)===D},w.isUndefined=function(t){return w(t)===C};n.default=w},function(t,n,r){!(function(){"use strict";function n(t){return f.lastIndex=0,f.test(t)?'"'+t.replace(f,(function(t){var n=a[t];return"string"==typeof n?n:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+t+'"'}var r,e,o=function(t,n){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n(r)},u=function(t,n){for(var r in t)n(r)},i=function(t,n,r){null!=t&&(r=r||{},Object.getOwnPropertyNames(t).forEach((function(t){r[t]||(n(t),r[t]=!0)})),i(Object.getPrototypeOf(t),n,r))};Object.defineProperty(Date.prototype,"toPrunedJSON",{value:Date.prototype.toJSON});var f=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},c=function(t,f,a){function c(t,o,u){var i,f,p,s,d=o[t];switch(d&&"object"==typeof d&&"function"==typeof d.toPrunedJSON&&(d=d.toPrunedJSON(t)),d&&"function"==typeof d.toJSON&&(d=d.toJSON()),typeof d){case"string":return n(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(u<=0||-1!==r.indexOf(d)){if(l){var y=l(d,A,!0);return void 0===y?void 0:""+y}return A}if(r.push(d),s=[],"[object Array]"===Object.prototype.toString.apply(d)){for(p=Math.min(d.length,a),i=0;i<p;i+=1)s[i]=c(i,d,u-1)||"null";return f="["+s.join(",")+"]",l&&d.length>a?l(d,f,!1):f}return e(d,(function(t){try{f=c(t,d,u-1),f&&s.push(n(t)+":"+f)}catch(t){}})),"{"+s.join(",")+"}";case"function":case"undefined":return l?l(d,void 0,!1):void 0}}var l,A='"-pruned-"';if("object"==typeof f){var p=f;f=p.depthDecr,a=p.arrayMaxLength,e=p.iterator||o,p.allProperties?e=i:p.inheritedProperties&&(e=u),"prunedString"in p&&(A=p.prunedString),p.replacer&&(l=p.replacer)}else e=o;return r=[],f=f||6,a=a||50,c("",{"":t},f)};c.log=function(){},c.forEachProperty=i,t.exports=c})()}])}));

@@ -20,6 +20,6 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

*/
export var OBJECT_CLASS_TYPE_MAP = OBJECT_CLASSES.reduce(function (objectClasses, type) {
objectClasses[type.toUpperCase()] = '[object ' + type + ']';
export var OBJECT_CLASS_TYPE_MAP = Object.keys(OBJECT_CLASS_MAP).reduce(function (objectClassTypes, objectClass) {
objectClassTypes[OBJECT_CLASS_MAP[objectClass].toUpperCase()] = objectClass;
return objectClasses;
return objectClassTypes;
}, {});

@@ -26,0 +26,0 @@

@@ -85,6 +85,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

* @param {*} object the object to get the stringification value for
* @param {string} [passedObjectClass] the object class for the object passed
* @returns {*} the value to stringify with
*/
export var getStringifiedValueByObjectClass = function getStringifiedValueByObjectClass(object) {
var objectClass = toString.call(object);
export var getStringifiedValueByObjectClass = function getStringifiedValueByObjectClass(object, passedObjectClass) {
var objectClass = passedObjectClass || toString.call(object);

@@ -199,3 +200,2 @@ if (~STRINGIFY_SELF_CLASSES.indexOf(objectClass)) {

var circularCounter = 1,
type = void 0,
objectClass = void 0;

@@ -211,8 +211,6 @@

if (value === null) {
return getStringifiedValueByObjectClass(value);
return getStringifiedValueByObjectClass(value, OBJECT_CLASS_TYPE_MAP.NULL);
}
type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
if (~STRINGIFY_TYPEOF_TYPES.indexOf(type)) {
if (~STRINGIFY_TYPEOF_TYPES.indexOf(typeof value === 'undefined' ? 'undefined' : _typeof(value))) {
return getValueForStringification(value);

@@ -228,3 +226,3 @@ }

if (~REPLACE_STRINGIFICATION_CLASSES.indexOf(objectClass)) {
return getStringifiedValueByObjectClass(value);
return getStringifiedValueByObjectClass(value, objectClass);
}

@@ -231,0 +229,0 @@

@@ -24,6 +24,6 @@ 'use strict';

*/
var OBJECT_CLASS_TYPE_MAP = exports.OBJECT_CLASS_TYPE_MAP = OBJECT_CLASSES.reduce(function (objectClasses, type) {
objectClasses[type.toUpperCase()] = '[object ' + type + ']';
var OBJECT_CLASS_TYPE_MAP = exports.OBJECT_CLASS_TYPE_MAP = Object.keys(OBJECT_CLASS_MAP).reduce(function (objectClassTypes, objectClass) {
objectClassTypes[OBJECT_CLASS_MAP[objectClass].toUpperCase()] = objectClass;
return objectClasses;
return objectClassTypes;
}, {});

@@ -30,0 +30,0 @@

@@ -96,6 +96,7 @@ 'use strict';

* @param {*} object the object to get the stringification value for
* @param {string} [passedObjectClass] the object class for the object passed
* @returns {*} the value to stringify with
*/
var getStringifiedValueByObjectClass = exports.getStringifiedValueByObjectClass = function getStringifiedValueByObjectClass(object) {
var objectClass = toString.call(object);
var getStringifiedValueByObjectClass = exports.getStringifiedValueByObjectClass = function getStringifiedValueByObjectClass(object, passedObjectClass) {
var objectClass = passedObjectClass || toString.call(object);

@@ -210,3 +211,2 @@ if (~_constants.STRINGIFY_SELF_CLASSES.indexOf(objectClass)) {

var circularCounter = 1,
type = void 0,
objectClass = void 0;

@@ -222,8 +222,6 @@

if (value === null) {
return getStringifiedValueByObjectClass(value);
return getStringifiedValueByObjectClass(value, _constants.OBJECT_CLASS_TYPE_MAP.NULL);
}
type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
if (~_constants.STRINGIFY_TYPEOF_TYPES.indexOf(type)) {
if (~_constants.STRINGIFY_TYPEOF_TYPES.indexOf(typeof value === 'undefined' ? 'undefined' : _typeof(value))) {
return getValueForStringification(value);

@@ -239,3 +237,3 @@ }

if (~_constants.REPLACE_STRINGIFICATION_CLASSES.indexOf(objectClass)) {
return getStringifiedValueByObjectClass(value);
return getStringifiedValueByObjectClass(value, objectClass);
}

@@ -242,0 +240,0 @@

@@ -52,5 +52,9 @@ {

"eslint-loader": "^1.9.0",
"faker": "^4.1.0",
"hash-object": "^0.1.7",
"html-webpack-plugin": "^2.30.1",
"in-publish": "2.0.0",
"node-object-hash": "^1.3.0",
"nyc": "^11.4.1",
"object-hash": "^1.2.0",
"optimize-js-plugin": "^0.0.4",

@@ -68,4 +72,4 @@ "react": "^16.2.0",

"hashcode",
"java",
"object-hash"
"object-hash",
"unique"
],

@@ -82,2 +86,3 @@ "license": "MIT",

"benchmark": "npm run transpile:lib && node benchmarks/index.js",
"benchmark:compare": "npm run transpile:lib && node benchmarks/compare.js",
"build": "NODE_ENV=development webpack --progress --colors --config=webpack/webpack.config.js",

@@ -101,3 +106,3 @@ "build:minified": "NODE_ENV=production webpack --progress --colors --config=webpack/webpack.config.minified.js",

},
"version": "3.1.1",
"version": "3.1.2",
"dependencies": {

@@ -104,0 +109,0 @@ "json-prune": "^1.1.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