@aokiapp/tlv
Version:
Tag-Length-Value (TLV) parser and builder library with schema support. Provides both parsing and building APIs as submodules.
16 lines (15 loc) • 445 B
JavaScript
import { TagClass } from "./types.js";
export * from "./codecs.js";
export * from "./types.js";
export function inferIsSetFromTag(tagClass, tagNumber) {
const cls = tagClass ?? TagClass.Universal;
if (typeof tagNumber !== "number")
return undefined;
if (cls === TagClass.Universal) {
if (tagNumber === 17)
return true;
if (tagNumber === 16)
return false;
}
return undefined;
}