LarpixClient/electron/node_modules/@peculiar/asn1-schema/build/cjs/helper.js
olcxja fb6c8b6ee9
All checks were successful
Android Build / publish (push) Successful in 55s
Linux Build / publish (push) Successful in 1m6s
update electron to v43
2026-07-09 22:38:33 +02:00

44 lines
1.2 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isConvertible = isConvertible;
exports.isTypeOfArray = isTypeOfArray;
exports.isArrayEqual = isArrayEqual;
function isConvertible(target) {
if (typeof target === "function" && target.prototype) {
if (target.prototype.toASN && target.prototype.fromASN) {
return true;
}
else {
return isConvertible(target.prototype);
}
}
else {
return !!(target && typeof target === "object" && "toASN" in target && "fromASN" in target);
}
}
function isTypeOfArray(target) {
if (target) {
const proto = Object.getPrototypeOf(target);
if (proto?.prototype?.constructor === Array) {
return true;
}
return isTypeOfArray(proto);
}
return false;
}
function isArrayEqual(bytes1, bytes2) {
if (!(bytes1 && bytes2)) {
return false;
}
if (bytes1.byteLength !== bytes2.byteLength) {
return false;
}
const b1 = new Uint8Array(bytes1);
const b2 = new Uint8Array(bytes2);
for (let i = 0; i < bytes1.byteLength; i++) {
if (b1[i] !== b2[i]) {
return false;
}
}
return true;
}