object-fingerprint 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +6 -2
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -52,7 +52,7 @@ var _getFingerprint = function _getFingerprint(object, algorithm) {
52
52
  case "boolean":
53
53
  return "b:".concat(object ? "t" : "f");
54
54
  case "function":
55
- throw new Error("You cannot pass a function as data item");
55
+ return "f:".concat(_crc["default"].str(object.toString(16)));
56
56
  case "number":
57
57
  return "n:".concat(object.toString());
58
58
  case "string":
@@ -71,7 +71,11 @@ var getObjectFingerprint = function getObjectFingerprint(value, algorithm) {
71
71
  try {
72
72
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
73
73
  var key = _step.value;
74
- buff += "".concat(key, "<").concat(index(value[key], algorithm), ">");
74
+ try {
75
+ buff += "".concat(key, "<").concat(index(value[key], algorithm), ">");
76
+ } catch (error) {
77
+ buff += "".concat(key, "<nn>");
78
+ }
75
79
  }
76
80
  } catch (err) {
77
81
  _iterator.e(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "object-fingerprint",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Simple and fast utility to create short, stable, and deterministic object fingerprints (object hash).",
5
5
  "main": "dist/index.js",
6
6
  "bin": "dist/index.js",
@@ -71,15 +71,15 @@
71
71
  }
72
72
  },
73
73
  "devDependencies": {
74
- "@babel/cli": "^7.26.4",
75
- "@babel/core": "^7.26.0",
76
- "@babel/node": "^7.26.0",
74
+ "@babel/cli": "^7.28.3",
75
+ "@babel/core": "^7.28.5",
76
+ "@babel/node": "^7.28.0",
77
77
  "@babel/plugin-proposal-class-properties": "^7.18.6",
78
78
  "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
79
- "@babel/plugin-transform-async-to-generator": "^7.25.9",
80
- "@babel/plugin-transform-runtime": "^7.25.9",
81
- "@babel/preset-env": "^7.26.0",
82
- "release-it": "^17.1.1"
79
+ "@babel/plugin-transform-async-to-generator": "^7.27.1",
80
+ "@babel/plugin-transform-runtime": "^7.28.5",
81
+ "@babel/preset-env": "^7.28.5",
82
+ "release-it": "^19.2.1"
83
83
  },
84
84
  "dependencies": {
85
85
  "crc-32": "^1.2.2",