| Server IP : 185.208.173.17 / Your IP : 87.236.161.98 Web Server : Microsoft-IIS/10.0 System : Windows NT SRV8576125506 10.0 build 26100 (Windows Server 2016) AMD64 User : IUSR ( 0) PHP Version : 7.4.13 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/parsmega.nuxt/node_modules/sitemap/dist/lib/ |
Upload File : |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const child_process_1 = require("child_process");
const errors_1 = require("./errors");
/**
* Verify the passed in xml is valid
* @param xml what you want validated
* @return {Promise<null>} resolves on valid rejects [error stderr]
*/
function xmlLint(xml) {
let args = ['--schema', './schema/all.xsd', '--noout', '-'];
if (typeof xml === 'string') {
args[args.length - 1] = xml;
}
return new Promise((resolve, reject) => {
child_process_1.execFile('which', ['xmllint'], (error, stdout, stderr) => {
if (error) {
reject([new errors_1.XMLLintUnavailable()]);
return;
}
let xmllint = child_process_1.execFile('xmllint', args, (error, stdout, stderr) => {
// @ts-ignore
if (error && error.code) {
reject([error, stderr]);
}
resolve();
});
if (xmllint.stdout) {
xmllint.stdout.unpipe();
if ((typeof xml !== 'string') && xml && xmllint.stdin) {
xml.pipe(xmllint.stdin);
}
}
});
});
}
exports.xmlLint = xmlLint;
//# sourceMappingURL=xmllint.js.map