From f873ccdbfbca6c5632c3f87e520c9d123e21a88b Mon Sep 17 00:00:00 2001 From: oceanroleplay Date: Thu, 6 Jan 2022 14:08:23 +0530 Subject: [PATCH] chore: update dep --- src/client.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/client.ts b/src/client.ts index 87a1a0c..11db31b 100644 --- a/src/client.ts +++ b/src/client.ts @@ -18,9 +18,14 @@ import { ITafOptions, } from "./index.js"; import axios from "axios"; -import { parse } from "fast-xml-parser"; +import { XMLParser } from "fast-xml-parser"; import { skyConditions } from "./Identifiers.js"; +const parser = new XMLParser({ + ignoreAttributes: false, + attributeNamePrefix: "", +}); + export class Client { private options?: IClientOptions; static api = { @@ -151,10 +156,7 @@ export class Client { } // parse xml - const parsedData = parse(res.data, { - ignoreAttributes: false, - attributeNamePrefix: "", - }); + const parsedData = parser.parse(res.data); const finalData = parsedData?.response?.data?.[this.selectField(options.datasource)];