@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.
package/dist/rrweb.cjs CHANGED
@@ -165,16 +165,18 @@ function getXPath(n2) {
165
165
  if (n2 === document.body) {
166
166
  return "/html/body";
167
167
  }
168
+ if (!n2.tagName) {
169
+ return "";
170
+ }
168
171
  const parentNode2 = index$1.parentNode(n2);
169
172
  if (!parentNode2 || !(parentNode2 instanceof Element)) {
170
173
  return "";
171
174
  }
172
175
  const siblings = Array.from(parentNode2.children).filter(
173
- (node2) => node2.tagName === n2.tagName
176
+ (node2) => node2.tagName && node2.tagName === n2.tagName
174
177
  );
175
178
  const index$1$1 = siblings.length > 1 ? `[${siblings.indexOf(n2) + 1}]` : "";
176
- const path = getXPath(parentNode2) + "/" + n2.tagName.toLowerCase() + index$1$1;
177
- return path;
179
+ return getXPath(parentNode2) + "/" + n2.tagName.toLowerCase() + index$1$1;
178
180
  }
179
181
  function isElement(n2) {
180
182
  return n2.nodeType === n2.ELEMENT_NODE;