MCPcopy Index your code
hub / github.com/Maps4HTML/MapML.js / copyAttributes

Method copyAttributes

src/map-style.js:86–95  ·  view source on GitHub ↗
(source, target)

Source from the content-addressed store, hash-verified

84 }
85
86 function copyAttributes(source, target) {
87 return Array.from(source.attributes).forEach((attribute) => {
88 if (
89 attribute.nodeName !== 'media' &&
90 attribute.nodeName !== 'data-testid'
91 ) {
92 target.setAttribute(attribute.nodeName, attribute.nodeValue);
93 }
94 });
95 }
96
97 // use observer to monitor the changes in mapStyle textContent
98 this._observer = new MutationObserver(() => {

Callers

nothing calls this directly

Calls 2

forEachMethod · 0.80
setAttributeMethod · 0.80

Tested by

no test coverage detected