MCPcopy Create free account
hub / github.com/stenciljs/core / getAssetFileHash

Function getAssetFileHash

src/compiler/prerender/prerender-optimize.ts:402–410  ·  view source on GitHub ↗
(sys: d.CompilerSystem, appDir: string, assetUrl: URL)

Source from the content-addressed store, hash-verified

400const hashedAssets = new Map<string, Promise<string | null>>();
401
402const getAssetFileHash = async (sys: d.CompilerSystem, appDir: string, assetUrl: URL) => {
403 let p = hashedAssets.get(assetUrl.pathname);
404 if (!p) {
405 const assetFilePath = join(appDir, assetUrl.pathname);
406 p = sys.generateFileHash(assetFilePath, 10);
407 hashedAssets.set(assetUrl.pathname, p);
408 }
409 return p;
410};
411
412const dataMinifiedAttr = 'data-m';

Callers 3

resolveUrlFunction · 0.85
hashAssetFunction · 0.85
hashPageStateAstAssetsFunction · 0.85

Calls 4

joinFunction · 0.85
generateFileHashMethod · 0.80
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected