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

Method get

packages/core/src/cache/FileCacheAdapter.ts:25–40  ·  view source on GitHub ↗

* @inheritDoc

(name: string)

Source from the content-addressed store, hash-verified

23 * @inheritDoc
24 */
25 get(name: string): any {
26 const path = this.path(name);
27
28 if (!existsSync(path)) {
29 return null;
30 }
31
32 const payload = fs.readJSONSync(path);
33 const hash = this.getHash(payload.origin);
34
35 if (!hash || payload.hash !== hash) {
36 return null;
37 }
38
39 return payload.data;
40 }
41
42 /**
43 * @inheritDoc

Callers

nothing calls this directly

Calls 3

pathMethod · 0.95
getHashMethod · 0.95
readJSONSyncMethod · 0.80

Tested by

no test coverage detected