node-object-hash
Advanced tools
@@ -69,3 +69,9 @@ "use strict"; | ||
| const constructorName = obj.constructor?.name ?? 'unknonw'; | ||
| const objectName = typeof obj.toString === 'function' ? obj.toString() : 'unknown'; | ||
| let objectName = 'unknown'; | ||
| if (typeof obj.toString === 'function') { | ||
| objectName = obj.toString(); | ||
| } | ||
| else if (Object.keys(obj).length > 0) { | ||
| objectName = JSON.stringify(obj); | ||
| } | ||
| return `<:${constructorName}>:${objectName}`; | ||
@@ -72,0 +78,0 @@ }, |
+1
-1
| { | ||
| "name": "node-object-hash", | ||
| "version": "3.1.0", | ||
| "version": "3.1.1", | ||
| "description": "Node.js object hash library with properties/arrays sorting to provide constant hashes", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
73025
0.43%1251
0.48%