resources-dedupe.ts#
4 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
4
symbols
3
functions
1
modules
9
parameters
3
returns
Reference#
fnhashResourceFile(filePath: string, ext: string, store: ResourceDedupeStore, reuseKey: string): Promise<string>SHA-256 of emitted bytes plus a NUL and the serving extension so the same paylo…
SHA-256 of emitted bytes plus a NUL and the serving extension so the same payload cannot be served under an incompatible media type.
Signature
export async function hashResourceFile(filePath: string, ext: string, store: ResourceDedupeStore, reuseKey: string): Promise<string>Parameters
-
filePathstring -
extstring -
storeResourceDedupeStore -
reuseKeystring
Returns
Promise<string>
fnlinkOrCopyAlias(canonical: string, alias: string, linker: typeof fs.link = fs.link): Promise<"link" | "copy">Prefer a hard link at the original output path. link failure removes any stale…
Prefer a hard link at the original output path. link failure removes any stale alias and copies so a shared inode is never overwritten.
Signature
export async function linkOrCopyAlias(canonical: string, alias: string, linker: typeof fs.link = fs.link): Promise<"link" | "copy">Parameters
-
canonicalstring -
aliasstring -
linkertypeof fs.linkoptional · default: fs.link
Returns
Promise<"link" | "copy">
moduleresources-dedupeSite-wide content-addressed emit for identical page-resource bytes. Hashing streams the file. The first digest+extensio…
Site-wide content-addressed emit for identical page-resource bytes.
Hashing streams the file. The first digest+extension pair writes once; later pages reuse that path. Image decode is never used here.
fnrewriteToCanonicalUrl(originalSrc: string, canonicalPath: string): stringKeep leftover search/hash; drop consumed transform params.
Keep leftover search/hash; drop consumed transform params.
Signature
export function rewriteToCanonicalUrl(originalSrc: string, canonicalPath: string): stringParameters
-
originalSrcstring -
canonicalPathstring
Returns
string