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

Method set

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

* @inheritDoc

(name: string, data: any, origin: string)

Source from the content-addressed store, hash-verified

43 * @inheritDoc
44 */
45 set(name: string, data: any, origin: string): void {
46 if (this.#options.combined) {
47 this.#cache[name.replace(/\.[jt]s$/, '')] = data;
48 return;
49 }
50
51 const path = this.path(name);
52 const hash = this.getHash(origin);
53 writeFileSync(
54 path,
55 JSON.stringify({ data, origin, hash, version: this.#VERSION }, null, this.#pretty ? 2 : undefined),
56 );
57 }
58
59 /**
60 * @inheritDoc

Callers

nothing calls this directly

Calls 2

pathMethod · 0.95
getHashMethod · 0.95

Tested by

no test coverage detected