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

Function transformSASS

packages/challenge-builder/src/transformers.js:204–218  ·  view source on GitHub ↗
(documentElement)

Source from the content-addressed store, hash-verified

202 `workers/${version}/sass-compile`
203);
204async function transformSASS(documentElement) {
205 // we only teach scss syntax, not sass. Also the compiler does not seem to be
206 // able to deal with sass.
207 const styleTags = documentElement.querySelectorAll(
208 'style[type~="text/scss"]'
209 );
210
211 await Promise.all(
212 [].map.call(styleTags, async style => {
213 style.type = 'text/css';
214 style.innerHTML = await sassWorkerExecutor.execute(style.innerHTML, 5000)
215 .done;
216 })
217 );
218}
219
220async function transformScript(documentElement, { useModules }) {
221 await loadBabel();

Callers 1

transformFunction · 0.85

Calls 1

executeMethod · 0.80

Tested by

no test coverage detected