mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-09 15:55:01 -04:00
Removed the require
This commit is contained in:
parent
ff29f55c11
commit
b950364606
1 changed files with 2 additions and 3 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
import Operation from "../Operation.mjs";
|
||||
import OperationError from "../errors/OperationError.mjs";
|
||||
import DOMParser from "xmldom";
|
||||
|
||||
/**
|
||||
* XML Validator operation
|
||||
|
@ -34,11 +35,9 @@ class XMLValidator extends Operation {
|
|||
*/
|
||||
run(input, args) {
|
||||
|
||||
const DOMParser = require("xmldom").DOMParser;
|
||||
|
||||
try {
|
||||
// Overwrite error handler since the built-in one does not raise exceptions.
|
||||
(new DOMParser({errorHandler: {
|
||||
(new DOMParser.DOMParser({errorHandler: {
|
||||
warning: (msg) => {
|
||||
throw new OperationError(msg);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue