@kfijolek/boardgamegeekclient
Version:
Javascript client to interact with BoardGameGeek public XML API
27 lines • 867 B
JavaScript
import { parse } from "fast-xml-parser";
export 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(parse(response, this.options));
});
}
}
//# sourceMappingURL=XmlResponseParser.js.map