object-fingerprint 1.1.1 → 1.1.2
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.
- package/dist/index.js +21 -17
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = index;
|
|
7
7
|
var _moment = _interopRequireDefault(require("moment"));
|
|
8
8
|
var _crc = _interopRequireDefault(require("crc-32"));
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
function _createForOfIteratorHelper(
|
|
11
|
-
function _unsupportedIterableToArray(
|
|
12
|
-
function _arrayLikeToArray(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
11
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
12
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13
13
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } /*
|
|
14
14
|
* MIT License
|
|
15
15
|
*
|
|
@@ -63,21 +63,25 @@ var _getFingerprint = function _getFingerprint(object, algorithm) {
|
|
|
63
63
|
};
|
|
64
64
|
var getObjectFingerprint = function getObjectFingerprint(value, algorithm) {
|
|
65
65
|
try {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
if (_typeof(value) === "object") {
|
|
67
|
+
var sortedKeys = Object.keys(value).sort();
|
|
68
|
+
var buff = "";
|
|
69
|
+
var _iterator = _createForOfIteratorHelper(sortedKeys),
|
|
70
|
+
_step;
|
|
71
|
+
try {
|
|
72
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
73
|
+
var key = _step.value;
|
|
74
|
+
buff += "".concat(key, "<").concat(index(value[key], algorithm), ">");
|
|
75
|
+
}
|
|
76
|
+
} catch (err) {
|
|
77
|
+
_iterator.e(err);
|
|
78
|
+
} finally {
|
|
79
|
+
_iterator.f();
|
|
74
80
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
_iterator.f();
|
|
81
|
+
return buff;
|
|
82
|
+
} else {
|
|
83
|
+
return JSON.parse(value);
|
|
79
84
|
}
|
|
80
|
-
return buff;
|
|
81
85
|
} catch (e) {
|
|
82
86
|
return "nn";
|
|
83
87
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "object-fingerprint",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
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,14 +71,14 @@
|
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@babel/cli": "^7.
|
|
75
|
-
"@babel/core": "^7.
|
|
76
|
-
"@babel/node": "^7.
|
|
74
|
+
"@babel/cli": "^7.26.4",
|
|
75
|
+
"@babel/core": "^7.26.0",
|
|
76
|
+
"@babel/node": "^7.26.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.
|
|
80
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
81
|
-
"@babel/preset-env": "^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
82
|
"release-it": "^17.1.1"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|