UNPKG

web-collect-events

Version:

An sdk for collecting events from web pages

17 lines (16 loc) 514 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isNodeValid = void 0; function isNodeValid(node) { const validTags = ["BUTTON", "INPUT", "A", "LINK", "IMG", "VIDEO", "AUDIO",]; let targetNode = node; for (let i = 0; i < 4; i++) { console.log(targetNode.tagName); if (validTags.includes(targetNode.tagName)) { return true; } targetNode = targetNode.parentNode; } return false; } exports.isNodeValid = isNodeValid;