@appsurify-testmap/rrweb-snapshot 2.0.0-alpha.21 → 2.0.0-alpha.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -159,16 +159,18 @@ function getXPath(n) {
159
159
  if (n === document.body) {
160
160
  return "/html/body";
161
161
  }
162
+ if (!n.tagName) {
163
+ return "";
164
+ }
162
165
  const parentNode2 = index.parentNode(n);
163
166
  if (!parentNode2 || !(parentNode2 instanceof Element)) {
164
167
  return "";
165
168
  }
166
169
  const siblings = Array.from(parentNode2.children).filter(
167
- (node2) => node2.tagName === n.tagName
170
+ (node2) => node2.tagName && node2.tagName === n.tagName
168
171
  );
169
172
  const index$1 = siblings.length > 1 ? `[${siblings.indexOf(n) + 1}]` : "";
170
- const path = getXPath(parentNode2) + "/" + n.tagName.toLowerCase() + index$1;
171
- return path;
173
+ return getXPath(parentNode2) + "/" + n.tagName.toLowerCase() + index$1;
172
174
  }
173
175
  function isElement(n) {
174
176
  return n.nodeType === n.ELEMENT_NODE;