MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / getHash

Method getHash

packages/core/src/cache/FileCacheAdapter.ts:104–114  ·  view source on GitHub ↗
(origin: string)

Source from the content-addressed store, hash-verified

102 }
103
104 private getHash(origin: string): string | null {
105 origin = fs.absolutePath(origin, this.#baseDir);
106
107 if (!existsSync(origin)) {
108 return null;
109 }
110
111 const contents = readFileSync(origin);
112
113 return Utils.hash(contents.toString() + this.#VERSION);
114 }
115}

Callers 2

getMethod · 0.95
setMethod · 0.95

Calls 3

absolutePathMethod · 0.80
hashMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected