MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / injectRuntime

Function injectRuntime

packages/cli/src/utils/compositionServer.ts:56–61  ·  view source on GitHub ↗
(html: string)

Source from the content-addressed store, hash-verified

54
55/** Inject the runtime <script> into composition HTML before </body> (or at the end). */
56export function injectRuntime(html: string): string {
57 const runtimeTag = `<script src="/runtime.js"></script>`;
58 return html.includes("</body>")
59 ? html.replace("</body>", `${runtimeTag}\n</body>`)
60 : html + `\n${runtimeTag}`;
61}
62
63const ASSET_CONTENT_TYPES: Record<string, string> = {
64 js: "application/javascript",

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected