@iotize/device-client.js
Version:
IoTize Device client for Javascript
35 lines (34 loc) • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var Util = /** @class */ (function () {
function Util() {
}
Util.computePadding = function (size, modulo) {
return (modulo - (size % modulo)) % modulo;
};
Util.jsonEquals = function (a1, a2) {
return JSON.stringify(a1) === JSON.stringify(a2);
};
Util.deepEqual = function (x, y) {
if (x === y) {
return true;
}
else if ((typeof x == "object" && x != null) && (typeof y == "object" && y != null)) {
if (Object.keys(x).length != Object.keys(y).length)
return false;
for (var prop in x) {
if (y.hasOwnProperty(prop)) {
if (!Util.deepEqual(x[prop], y[prop]))
return false;
}
else
return false;
}
return true;
}
else
return false;
};
return Util;
}());
exports.Util = Util;