MCPcopy Index your code
hub / github.com/cure53/DOMPurify / wideAttrs

Function wideAttrs

scripts/benchmark.js:100–113  ·  view source on GitHub ↗
(n)

Source from the content-addressed store, hash-verified

98}
99
100function wideAttrs(n) {
101 // Attribute-heavy flat list: exercises _sanitizeAttributes /
102 // _isValidAttribute per-attribute costs.
103 let html = '';
104 for (let i = 0; i < n; i++) {
105 html +=
106 `<a id="link-${i}" class="c${i % 7} item" href="https://example.com/p/${i}"` +
107 ` title="item ${i}" data-index="${i}" data-group="g${i % 5}"` +
108 ` aria-label="open item ${i}" target="_blank" rel="noopener"` +
109 ` style="color: rgb(${i % 255}, 0, 0)">item ${i}</a>`;
110 }
111
112 return html;
113}
114
115function textHeavy(n) {
116 // Many text nodes, some carrying template expressions; pair with

Callers 1

benchmark.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…