(script, source, contents)
| 271 | }; |
| 272 | |
| 273 | export const embedScript = (script, source, contents) => { |
| 274 | const code = contents ?? ''; |
| 275 | |
| 276 | script.innerHTML = script.hasAttribute('defer') ? deferScript(code) : code; |
| 277 | script.removeAttribute('src'); |
| 278 | script.setAttribute('data-src', source); |
| 279 | }; |
| 280 | |
| 281 | // This does the final transformations of the files needed to embed them into |
| 282 | // HTML. |
no test coverage detected