HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/node_modules/@capacitor/cli/dist/util/xml.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.buildXmlElement = exports.writeXML = exports.parseXML = exports.readXML = void 0;
const tslib_1 = require("tslib");
const utils_fs_1 = require("@ionic/utils-fs");
const xml2js_1 = tslib_1.__importDefault(require("xml2js"));
async function readXML(path) {
    var _a;
    try {
        const xmlStr = await (0, utils_fs_1.readFile)(path, { encoding: 'utf-8' });
        try {
            return await xml2js_1.default.parseStringPromise(xmlStr);
        }
        catch (e) {
            throw `Error parsing: ${path}, ${(_a = e.stack) !== null && _a !== void 0 ? _a : e}`;
        }
    }
    catch (e) {
        throw `Unable to read: ${path}`;
    }
}
exports.readXML = readXML;
function parseXML(xmlStr, options) {
    const parser = options !== undefined
        ? new xml2js_1.default.Parser({ ...options })
        : new xml2js_1.default.Parser();
    let xmlObj;
    parser.parseString(xmlStr, (err, result) => {
        if (!err) {
            xmlObj = result;
        }
    });
    return xmlObj;
}
exports.parseXML = parseXML;
async function writeXML(object) {
    return new Promise(resolve => {
        const builder = new xml2js_1.default.Builder({
            headless: true,
            explicitRoot: false,
            rootName: 'deleteme',
        });
        let xml = builder.buildObject(object);
        xml = xml.replace('<deleteme>', '').replace('</deleteme>', '');
        resolve(xml);
    });
}
exports.writeXML = writeXML;
function buildXmlElement(configElement, rootName) {
    const builder = new xml2js_1.default.Builder({
        headless: true,
        explicitRoot: false,
        rootName: rootName,
    });
    return builder.buildObject(configElement);
}
exports.buildXmlElement = buildXmlElement;