MCPcopy
hub / github.com/jestjs/jest / resolveCached

Method resolveCached

packages/jest-runtime/src/internals/Resolution.ts:221–233  ·  view source on GitHub ↗
(
    from: string,
    to: string,
    cache: Map<string, string>,
    conditions: ReadonlyArray<string>,
  )

Source from the content-addressed store, hash-verified

219 }
220
221 private resolveCached(
222 from: string,
223 to: string,
224 cache: Map<string, string>,
225 conditions: ReadonlyArray<string>,
226 ): string {
227 const key = `${from}\0${to}`;
228 const cached = cache.get(key);
229 if (cached !== undefined) return cached;
230 const resolved = this.resolver.resolveModule(from, to, {conditions});
231 cache.set(key, resolved);
232 return resolved;
233 }
234}

Callers 2

resolveCjsMethod · 0.95
resolveEsmMethod · 0.95

Calls 3

getMethod · 0.45
resolveModuleMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected