Fix ParseTR34B9Envelope lint: JSDoc on parseAsnLength, hexStr, constructor

This commit is contained in:
Jacob Marks 2026-05-16 23:35:31 -04:00
parent 0dda2fe08a
commit 6bbafe7ff3

View File

@ -39,6 +39,13 @@ const TR34_ERROR_CODES = {
// ── ASN.1 helpers ───────────────────────────────────────────────────────────── // ── ASN.1 helpers ─────────────────────────────────────────────────────────────
/**
* Parses an ASN.1 length field at the given offset.
*
* @param {Uint8Array} bytes
* @param {number} offset
* @returns {{headerLength: number, valueLength: number}}
*/
function parseAsnLength(bytes, offset) { function parseAsnLength(bytes, offset) {
if (offset + 2 > bytes.length) if (offset + 2 > bytes.length)
throw new OperationError("Insufficient ASN.1 data."); throw new OperationError("Insufficient ASN.1 data.");
@ -76,6 +83,12 @@ function peekAsnSequence(bytes) {
} }
} }
/**
* Converts a Uint8Array to an uppercase hex string.
*
* @param {Uint8Array} bytes
* @returns {string}
*/
function hexStr(bytes) { function hexStr(bytes) {
return Array.from(bytes, b => b.toString(16).padStart(2, "0").toUpperCase()).join(""); return Array.from(bytes, b => b.toString(16).padStart(2, "0").toUpperCase()).join("");
} }
@ -87,6 +100,9 @@ function hexStr(bytes) {
*/ */
class ParseTR34B9Envelope extends Operation { class ParseTR34B9Envelope extends Operation {
/**
* ParseTR34B9Envelope constructor.
*/
constructor() { constructor() {
super(); super();