How to use the default function from xml2js
Find comprehensive JavaScript xml2js.default code examples handpicked from public code repositorys.
GitHub: coda/packs-sdk
94 95 96 97 98 99 100 101 102 103
if (responseBody && responseBody.length >= MaxContentLengthBytes) { throw new Error(`Response body is too large for Coda. Body is ${responseBody.length} bytes.`); } try { if (isXmlContentType(response.headers['content-type']) && !request.isBinaryResponse) { responseBody = await xml2js_1.default.parseStringPromise(responseBody, { explicitRoot: false }); } else { responseBody = JSON.parse(responseBody); }
18
68
16
19 20 21 22 23 24 25 26 27 28
return resolve(null); if (!res.ok) reject(new Error("Result not ok")); res.text() .then((xml) => { xml2js_1.default.parseString(xml, (err, data) => { if (err !== null) reject(err); let channel = { title: data.feed.title[0],
0
7
4
+ 3 other calls in file
xml2js.parseStringPromise is the most popular function in xml2js (162 examples)