UNPKG

emvco-qr-sdk

Version:

A robust TypeScript SDK for decoding, validating, and processing EMVCo-compliant QR codes used in digital payment systems.

42 lines (41 loc) 1.54 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TLVUtil = void 0; const tag_name_resolver_util_1 = require("./tag-name-resolver.util"); /** * Facade utility class for resolving TLV tag and subtag names. * * Delegates tag name resolution to the appropriate region-specific resolver. * Provides a clean interface for resolving field names from raw TLV tags. */ class TLVUtil { /** * Resolves a TLV tag to its EMVCo standard name. * * @param tag - A string tag identifier (e.g., "00", "54"). * @returns The corresponding field name or the raw tag. */ static getStandardName(tag) { return tag_name_resolver_util_1.TagNameResolverUtil.getStandardName(tag); } /** * Resolves a TLV tag to its Colombian-specific name. * * @param tag - A string tag identifier. * @returns The field name under Colombian QR mapping or the raw tag. */ static getColombianName(tag) { return tag_name_resolver_util_1.TagNameResolverUtil.getColombianName(tag); } /** * Resolves a subtag for a given parent tag based on Colombian QR mappings. * * @param parentTag - The top-level TLV tag. * @param subtag - A subfield tag under the parent. * @returns The resolved subfield name or the raw subtag if unknown. */ static getColombianSubtagName(parentTag, subtag) { return tag_name_resolver_util_1.TagNameResolverUtil.getColombianSubtagName(parentTag, subtag); } } exports.TLVUtil = TLVUtil;