Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(xmlSource: XMLNode) {
super(xmlSource.$.name, "source", xmlSource.$.sourcePath, xmlSource.children("Definition"));
const nameParts = xmlSource.$.name.split(".");
nameParts.pop();
const fakeNode = new XMLNode("");
fakeNode.appendAttribute("name", "$");
fakeNode.appendAttribute("ref", nameParts.join("."));
this.imports = [
new Import(fakeNode),
...this.parseImports(xmlSource.children("Import"))
];
}
debug(command: string, opts?: object): Promise {
if (!this.isDebugging()) {
return Promise.resolve(new XMLNode(command));
}
return this.WUCDebug(command, opts).then((response: XMLNode) => {
const retVal: XMLNode[] = response.children(command);
if (retVal.length) {
return retVal[0];
}
return new XMLNode(command);
}).catch((_) => {
logger.error(_);
return Promise.resolve(new XMLNode(command));
});
}
}).catch((_) => {
logger.error(_);
return Promise.resolve(new XMLNode(command));
});
}
return this.WUCDebug(command, opts).then((response: XMLNode) => {
const retVal: XMLNode[] = response.children(command);
if (retVal.length) {
return retVal[0];
}
return new XMLNode(command);
}).catch((_) => {
logger.error(_);