UNPKG

o2-client

Version:

Light Client for O2 Blockchain

34 lines (29 loc) 940 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); 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; }; exports.isObject = isObject; exports.compareUint8Arrays = compareUint8Arrays; /** * Check if element is of type Object * @param obj * @returns {boolean} */ function isObject(obj) { return (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && !Array.isArray(obj) && obj !== null && !(obj instanceof Date); } /** * Compare two Uint8Arrays * @param a {Uint8Array} * @param b {Uint8Array} * @returns {boolean} */ function compareUint8Arrays(a, b) { for (var i = 0; i < a.length; i++) { if (a[i] !== b[i]) { return false; } } return true; }