@kfijolek/boardgamegeekclient
Version:
TypeScript client to interact with BoardGameGeek public XML API
31 lines • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.XmlResponseParser = void 0;
const fast_xml_parser_1 = require("fast-xml-parser");
class XmlResponseParser {
constructor() {
this.options = {
attributeNamePrefix: "@_",
// attrNodeName: "attr",
textNodeName: "#text",
ignoreAttributes: false,
ignoreNameSpace: true,
allowBooleanAttributes: true,
parseNodeValue: true,
parseAttributeValue: true,
trimValues: true,
cdataTagName: "__cdata",
cdataPositionChar: "\\c",
parseTrueNumberOnly: false,
arrayMode: true,
stopNodes: ["parse-me-as-string"]
};
}
parseResponse(response) {
return new Promise(resolve => {
resolve((0, fast_xml_parser_1.parse)(response, this.options));
});
}
}
exports.XmlResponseParser = XmlResponseParser;
//# sourceMappingURL=XmlResponseParser.js.map