Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
walk(callback) {
return walk.call(this, callback);
}
module.exports = function(node) {
let test = false;
if(!node.tag || node.tag !== "form" || !node.content.length) {
return node;
}
walk.call(node, (subNode) => {
if(test || !subNode.tag || eligibleTags.indexOf(subNode.tag) === -1 ||
(subNode.tag === "input" && get(subNode, [ "attrs", "type"]) !== "submit")) {
return subNode;
}
test = true;
addClassNameToNode(subNode, className);
return subNode;
});
return node;
};