MCPcopy Create free account
hub / github.com/vercel/vercel / resolveCachedCliInvocation

Function resolveCachedCliInvocation

packages/cli-exec/src/lookup.ts:121–144  ·  view source on GitHub ↗
(
  cwd: string,
  pathValue: string
)

Source from the content-addressed store, hash-verified

119 * Resolves and caches the full CLI resolution, including miss diagnostics.
120 */
121export function resolveCachedCliInvocation(
122 cwd: string,
123 pathValue: string
124): Promise<
125 | ResolvedVercelCliInvocation
126 | {
127 found: false;
128 diagnostics: ResolutionDiagnostics;
129 }
130> {
131 const cacheKey = getCliInvocationCacheKey(cwd, pathValue);
132
133 if (cliInvocationCache.has(cacheKey)) {
134 return cliInvocationCache.get(cacheKey)!;
135 }
136
137 const resolution = resolveCliInvocation(cwd, pathValue).catch(error => {
138 cliInvocationCache.delete(cacheKey);
139 throw error;
140 });
141
142 cliInvocationCache.set(cacheKey, resolution);
143 return resolution;
144}
145
146/**
147 * Removes internal resolution diagnostics from a successful CLI lookup result.

Callers 2

resolveInvocationOrThrowFunction · 0.90
findVercelCliFunction · 0.85

Calls 6

getCliInvocationCacheKeyFunction · 0.85
resolveCliInvocationFunction · 0.85
getMethod · 0.65
hasMethod · 0.45
deleteMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected