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

Function getBabelOptions

packages/challenge-builder/src/transformers.js:184–199  ·  view source on GitHub ↗
(
  presets,
  { preview, disableLoopProtectTests, disableLoopProtectPreview } = {
    preview: false,
    disableLoopProtectTests: false,
    disableLoopProtectPreview: false
  }
)

Source from the content-addressed store, hash-verified

182};
183
184function getBabelOptions(
185 presets,
186 { preview, disableLoopProtectTests, disableLoopProtectPreview } = {
187 preview: false,
188 disableLoopProtectTests: false,
189 disableLoopProtectPreview: false
190 }
191) {
192 // we protect the preview unless specifically disabled, since it evaluates as
193 // the user types and they may briefly have infinite looping code accidentally
194 if (preview && !disableLoopProtectPreview)
195 return { ...presets, plugins: ['loopProtection'] };
196 if (!disableLoopProtectTests)
197 return { ...presets, plugins: ['testLoopProtection'] };
198 return presets;
199}
200
201const sassWorkerExecutor = new WorkerExecutor(
202 `workers/${version}/sass-compile`

Callers 5

getJSTranspilerFunction · 0.85
getJSXTranspilerFunction · 0.85
getJSXModuleTranspilerFunction · 0.85
getTSTranspilerFunction · 0.85
getTSXModuleTranspilerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected