MCPcopy Create free account
hub / github.com/observablehq/framework / getModuleHash

Function getModuleHash

src/javascript/module.ts:59–61  ·  view source on GitHub ↗
(root: string, path: string, getHash?: (p: string) => string)

Source from the content-addressed store, hash-verified

57 * transitive imports or files that are invalid or do not exist.
58 */
59export function getModuleHash(root: string, path: string, getHash?: (p: string) => string): string {
60 return getModuleHashInternal(root, path, getHash).digest("hex");
61}
62
63function getModuleHashInternal(root: string, path: string, getHash = (p: string) => getFileHash(root, p)): Hash {
64 const hash = createHash("sha256");

Callers 5

module-test.tsFile · 0.85
getModuleHashMethod · 0.85
getModuleResolversFunction · 0.85
resolveImportPathFunction · 0.85
buildFunction · 0.85

Calls 1

getModuleHashInternalFunction · 0.85

Tested by

no test coverage detected