UNPKG

903 BJavaScriptView Raw
1"use strict";
2var __importStar = (this && this.__importStar) || function (mod) {
3 if (mod && mod.__esModule) return mod;
4 var result = {};
5 if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6 result["default"] = mod;
7 return result;
8};
9Object.defineProperty(exports, "__esModule", { value: true });
10const core_1 = require("@akala/core");
11const xml2js = __importStar(require("xml2js"));
12core_1.FetchHttp.prototype['getXML'] = function (url) {
13 return this.call({ url: url, method: 'get' }).then(r => r.text().then(text => {
14 return new Promise((resolve, reject) => {
15 xml2js.parseString(text, { async: true }, function (err, result) {
16 if (err)
17 reject(err);
18 else
19 resolve(result);
20 });
21 });
22 }));
23};
24//# sourceMappingURL=http.js.map
\No newline at end of file