How to use the default function from xml2js

Find comprehensive JavaScript xml2js.default code examples handpicked from public code repositorys.

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);
    }
fork icon18
star icon68
watch icon16

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],
fork icon0
star icon7
watch icon4

+ 3 other calls in file