MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / embedScript

Function embedScript

packages/challenge-builder/src/transformers.js:273–279  ·  view source on GitHub ↗
(script, source, contents)

Source from the content-addressed store, hash-verified

271};
272
273export 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.

Callers 2

embedStylesAndScriptFunction · 0.85

Calls 1

deferScriptFunction · 0.85

Tested by

no test coverage detected