MCPcopy
hub / github.com/ampproject/amphtml / splitWrapper

Function splitWrapper

build-system/tasks/helpers.js:280–288  ·  view source on GitHub ↗

* Splits up the wrapper to compute the banner and footer * @return {object}

()

Source from the content-addressed store, hash-verified

278 * @return {object}
279 */
280 function splitWrapper() {
281 const wrapper = options.wrapper ?? wrappers.none;
282 const sentinel = '<%= contents %>';
283 const start = wrapper.indexOf(sentinel);
284 return {
285 banner: {js: wrapper.slice(0, start)},
286 footer: {js: wrapper.slice(start + sentinel.length)},
287 };
288 }
289 const {banner, footer} = splitWrapper();
290 const config = await getAmpConfigForFile(destFilename, options);
291 const compiledFile = await getCompiledFile(srcFilename);

Callers 1

esbuildCompileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected