Removed the require

This commit is contained in:
n1073645 2020-04-17 15:07:02 +01:00
parent ff29f55c11
commit b950364606

View file

@ -6,6 +6,7 @@
import Operation from "../Operation.mjs"; import Operation from "../Operation.mjs";
import OperationError from "../errors/OperationError.mjs"; import OperationError from "../errors/OperationError.mjs";
import DOMParser from "xmldom";
/** /**
* XML Validator operation * XML Validator operation
@ -34,11 +35,9 @@ class XMLValidator extends Operation {
*/ */
run(input, args) { run(input, args) {
const DOMParser = require("xmldom").DOMParser;
try { try {
// Overwrite error handler since the built-in one does not raise exceptions. // Overwrite error handler since the built-in one does not raise exceptions.
(new DOMParser({errorHandler: { (new DOMParser.DOMParser({errorHandler: {
warning: (msg) => { warning: (msg) => {
throw new OperationError(msg); throw new OperationError(msg);
}, },