UNPKG

camtjs

Version:

JS package to work with CAMT transactions

30 lines (29 loc) 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Currency = exports.Camt052 = void 0; const processors_1 = require("xml2js/lib/processors"); const xml_parser_1 = require("../xml-parser"); const camt052_utils_1 = require("./camt052-utils"); class Camt052 { document = null; constructor(camt052Document) { this.document = camt052Document; } static async parseCamt(xml) { const xmlDocument = await (0, xml_parser_1.parseStringToXml)(xml, { charkey: 'value', attrkey: 'attributes', tagNameProcessors: [camt052_utils_1.renameTags], attrNameProcessors: [camt052_utils_1.renameTags], valueProcessors: [processors_1.parseNumbers, processors_1.parseBooleans], preserveChildrenOrder: true, explicitArray: false, }); return new Camt052(xmlDocument.Document); } } exports.Camt052 = Camt052; var Currency; (function (Currency) { Currency["Eur"] = "EUR"; })(Currency = exports.Currency || (exports.Currency = {}));