@percy/dom
Advanced tools
Comparing version 1.28.2-beta.1 to 1.28.2-beta.2
@@ -372,2 +372,24 @@ (function() { | ||
let mimetype = null; | ||
function getBase64Substring(src) { | ||
let base64Index = src.indexOf(';base64,'); | ||
if (base64Index === -1) return null; | ||
mimetype = src.substring(5, base64Index); | ||
base64Index += ';base64,'.length; | ||
return src.substring(base64Index); | ||
} | ||
function serializeBase64(node, resources) { | ||
let src = node.src; | ||
// skip if src is null | ||
if (src == null) return; | ||
let base64String = getBase64Substring(src); | ||
// skip if src is not base64 | ||
if (base64String == null) return; | ||
// create a resource from the serialized data url | ||
let resource = resourceFromText(uid(), mimetype, base64String); | ||
resources.add(resource); | ||
node.src = resource.url; | ||
} | ||
/** | ||
@@ -388,3 +410,4 @@ * Custom deep clone function that replaces Percy's current clone behavior. | ||
dom, | ||
disableShadowDOM | ||
disableShadowDOM, | ||
resources | ||
} = _ref; | ||
@@ -408,2 +431,3 @@ // clones shadow DOM and light DOM for a given node | ||
applyElementTransformations(clone); | ||
serializeBase64(clone, resources); | ||
parent.appendChild(clone); | ||
@@ -410,0 +434,0 @@ |
{ | ||
"name": "@percy/dom", | ||
"version": "1.28.2-beta.1", | ||
"version": "1.28.2-beta.2", | ||
"license": "MIT", | ||
@@ -38,3 +38,3 @@ "repository": { | ||
}, | ||
"gitHead": "c4d0637366dbc28eeda234f93d44424d9c565f49" | ||
"gitHead": "7c2bdccd896be9da7d07dd30ead802fbb4ca9fab" | ||
} |
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
32575
623