UNPKG

tlv-parser

Version:

Zero-dependency recursive TLV (Tag-Length-Value) parser in pure ES modules. Supports raw TLVNode[] or nested object keyed by tag.

12 lines (11 loc) 252 B
export class TLVNode { constructor(tag, length, data = "", children = []) { this.tag = tag; this.length = length; this.data = data; this.children = children; } hasChildren() { return this.children.length > 0; } }