Skip to main content

Function: checkMetadataFreshness()

checkMetadataFreshness(contentHashes, resolveContent, hashContent): Promise<MetadataFreshnessResult>

Defined in: packages/core/src/application/use-cases/_shared/metadata-freshness.ts:30

Checks whether recorded content hashes match the current file contents.

Parameters

contentHashes

Record<string, string> | undefined

Recorded hashes from metadata.json (contentHashes field). When undefined or empty, the result is { allFresh: false, entries: [] }.

resolveContent

(filename) => Promise<string | null>

Async function that returns the current content of a file by filename, or null if the file does not exist.

hashContent

(content) => string

Function that computes a content hash string (e.g. sha256:…).

Returns

Promise<MetadataFreshnessResult>

Freshness result with per-file details