UNPKG

@n3okill/utils

Version:
27 lines 877 B
"use strict"; /* global NodeJS */ Object.defineProperty(exports, "__esModule", { value: true }); exports.equalTypedArray = equalTypedArray; const equal_1 = require("./equal"); /** * If the two arrays are of the same length, and they have the same number of elements, then the * elements of the two arrays are compared. If they are all equal, then the two arrays are equal * @param {T} a - The first array to compare. * @param {T} b - The array to compare to a. */ function equalTypedArray(a, b) { if (a.length !== b.length) { return false; } if (a.length === 0) { return true; } for (let i = 0; i < a.length; i++) { // eslint-disable-next-line security/detect-object-injection if (!(0, equal_1.equal)(a[i], b[i])) { return false; } } return true; } //# sourceMappingURL=equalTypedArray.js.map