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