MCPcopy Index your code
hub / github.com/stenciljs/core / formatText

Function formatText

src/compiler/bundle/ext-format-plugin.ts:49–52  ·  view source on GitHub ↗
(code: string, filePath: string)

Source from the content-addressed store, hash-verified

47const DATAURL_MAX_IMAGE_SIZE = 4 * 1024; // 4KiB
48
49const formatText = (code: string, filePath: string) => {
50 const varName = createJsVarName(basename(filePath));
51 return `const ${varName} = ${JSON.stringify(code)};export default ${varName};`;
52};
53
54const formatUrl = (
55 config: d.ValidatedConfig,

Callers 2

transformFunction · 0.85
formatUrlFunction · 0.85

Calls 1

createJsVarNameFunction · 0.85

Tested by

no test coverage detected