@applitools/dom-capture
Advanced tools
Comparing version 1.1.0 to 1.2.0
const captureDom = require('./src/captureDom'); | ||
const mergeCaptures = require('./src/mergeCaptures'); | ||
module.exports = { | ||
captureDom, | ||
mergeCaptures, | ||
}; |
{ | ||
"name": "@applitools/dom-capture", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -13,2 +13,6 @@ /* global window, document */ | ||
function notEmptyObj(obj) { | ||
return Object.keys(obj).length ? obj : undefined; | ||
} | ||
function iframeToJSON(el) { | ||
@@ -39,4 +43,6 @@ const obj = elementToJSON(el); | ||
const attributes = {}; | ||
for (const p of attributeProps.all) { | ||
if (el.hasAttribute(p)) attributes[p] = el.getAttribute(p); | ||
if (attributeProps.all) { | ||
for (const p of attributeProps.all) { | ||
if (el.hasAttribute(p)) attributes[p] = el.getAttribute(p); | ||
} | ||
} | ||
@@ -52,5 +58,5 @@ | ||
tagName, | ||
style, | ||
rect, | ||
attributes: Object.keys(attributes).length ? attributes : undefined, | ||
style: notEmptyObj(style), | ||
rect: notEmptyObj(rect), | ||
attributes: notEmptyObj(attributes), | ||
childNodes: Array.prototype.map.call(el.childNodes, captureNode).filter(filter), | ||
@@ -57,0 +63,0 @@ }; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2983
82