Files
NapCatQQ/.pnpm-store/v3/files/76/06936ddbf931de332589a7da3d94b99d5f3c0cda943dc0d7ceaba1a8fb21fa13df6f0bc878f249765443aaed9709754a245a016b1148ca06d65d3d399b77eb
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

41 lines
1.2 KiB
Plaintext

export 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);
}
}
export function isTypeOfArray(target) {
var _a;
if (target) {
const proto = Object.getPrototypeOf(target);
if (((_a = proto === null || proto === void 0 ? void 0 : proto.prototype) === null || _a === void 0 ? void 0 : _a.constructor) === Array) {
return true;
}
return isTypeOfArray(proto);
}
return false;
}
export 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;
}