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

Function localizeHtmlEntry

packages/cli/src/utils/publishProject.ts:294–302  ·  view source on GitHub ↗
(ctx: ExternalAssetContext, entryPath: string, content: Buffer)

Source from the content-addressed store, hash-verified

292}
293
294function localizeHtmlEntry(ctx: ExternalAssetContext, entryPath: string, content: Buffer): void {
295 const referrerAbsDir = resolve(ctx.absProjectDir, dirname(entryPath));
296 const { document } = parseHTML(content.toString("utf-8"));
297 const attrsChanged = rewriteHtmlAttributes(ctx, document, referrerAbsDir, entryPath);
298 const stylesChanged = rewriteStyleBlocks(ctx, document, referrerAbsDir, entryPath);
299 if (attrsChanged || stylesChanged) {
300 ctx.fileContents.set(entryPath, Buffer.from(document.toString(), "utf-8"));
301 }
302}
303
304function localizeCssEntry(ctx: ExternalAssetContext, entryPath: string, content: Buffer): void {
305 const referrerAbsDir = resolve(ctx.absProjectDir, dirname(entryPath));

Callers 1

localizeExternalAssetsFunction · 0.85

Calls 5

resolveFunction · 0.85
rewriteHtmlAttributesFunction · 0.85
rewriteStyleBlocksFunction · 0.85
fromMethod · 0.80
setMethod · 0.65

Tested by

no test coverage detected