@wildpeaks/snapshot-dom
Version:
Converts a DOM element to a JSON tree
1 lines • 271 B
JavaScript
;window.snapshotRemoveEmptyAttributes=function t(e){if("object"==typeof e&&null!==e&&(Array.isArray(e.childNodes)&&e.childNodes.forEach(t),e.attributes)){const t=[];for(const s in e.attributes)e.attributes[s]||t.push(s);t.forEach(t=>delete e.attributes[t])}};