MCPcopy
hub / github.com/webpack/webpack / getAttributesMap

Method getAttributesMap

lib/html/HtmlParser.js:1079–1091  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1077 /** @type {Map<string, string> | undefined} */
1078 let attributesMap;
1079 const getAttributesMap = () => {
1080 if (attributesMap) return attributesMap;
1081 attributesMap = new Map();
1082 for (const attr of attrs) {
1083 // Decoded values — filters and type resolvers compare what
1084 // the browser sees (e.g. `rel="&#105;con"` means `icon`)
1085 attributesMap.set(
1086 attr.name,
1087 decodeHtmlEntities(attr.value, true)
1088 );
1089 }
1090 return attributesMap;
1091 };
1092
1093 // Each matched attribute is a source; the element body (inline
1094 // `<style>`/`<script>`) is one more — content rather than an attribute.

Callers

nothing calls this directly

Calls 2

decodeHtmlEntitiesFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected