mirror of
https://github.com/gchq/CyberChef
synced 2024-11-15 00:57:08 +00:00
declare function as const and added Node.DOCUMENT_NODE
This commit is contained in:
parent
befb89ba76
commit
d5f84abb3b
1 changed files with 2 additions and 1 deletions
|
@ -330,12 +330,13 @@ var Extract = {
|
|||
}
|
||||
|
||||
var serializer = new XMLSerializer();
|
||||
var nodeToString = function(node) {
|
||||
const nodeToString = function(node) {
|
||||
const { nodeType, value, wholeText, data } = node;
|
||||
switch (nodeType) {
|
||||
case Node.ELEMENT_NODE: return serializer.serializeToString(node);
|
||||
case Node.ATTRIBUTE_NODE: return value;
|
||||
case Node.COMMENT_NODE: return data;
|
||||
case Node.DOCUMENT_NODE: return serializer.serializeToString(node);
|
||||
default: throw new Error(`Unknown Node Type: ${nodeType}`);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue