Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, _reject) => {
const fileData = fs.readFileSync(filePath, "ascii");
const retVal = xml2json(fileData as any);
if (removeOnRead) {
fs.unlink(filePath, (err) => { });
}
resolve(retVal);
});
}
return this._connection.send("WUCDebug", request).then((response) => {
const retVal = xml2json(response.Result);
const children = retVal.children();
if (children.length) {
return children[0];
}
return null;
});
}