mirror of
https://github.com/gchq/CyberChef.git
synced 2025-05-10 00:05:11 -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 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);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue