@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.
@@ -205,16 +205,18 @@ function getXPath(n) {
205
205
  if (n === document.body) {
206
206
  return "/html/body";
207
207
  }
208
+ if (!n.tagName) {
209
+ return "";
210
+ }
208
211
  const parentNode2 = index.parentNode(n);
209
212
  if (!parentNode2 || !(parentNode2 instanceof Element)) {
210
213
  return "";
211
214
  }
212
215
  const siblings = Array.from(parentNode2.children).filter(
213
- (node2) => node2.tagName === n.tagName
216
+ (node2) => node2.tagName && node2.tagName === n.tagName
214
217
  );
215
218
  const index$1 = siblings.length > 1 ? `[${siblings.indexOf(n) + 1}]` : "";
216
- const path = getXPath(parentNode2) + "/" + n.tagName.toLowerCase() + index$1;
217
- return path;
219
+ return getXPath(parentNode2) + "/" + n.tagName.toLowerCase() + index$1;
218
220
  }
219
221
  function isElement(n) {
220
222
  return n.nodeType === n.ELEMENT_NODE;