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

Method saveCache

packages/cli/src/util/openapi/openapi-cache.ts:285–297  ·  view source on GitHub ↗

* Save public spec to disk cache

(cachePath: string, spec: OpenApiSpec)

Source from the content-addressed store, hash-verified

283 * Save public spec to disk cache
284 */
285 private async saveCache(cachePath: string, spec: OpenApiSpec): Promise<void> {
286 const cached: CachedSpec = {
287 fetchedAt: Date.now(),
288 spec,
289 };
290
291 // Ensure directory exists
292 const dir = join(cachePath, '..');
293 await mkdir(dir, { recursive: true });
294
295 await writeFile(cachePath, JSON.stringify(cached));
296 output.debug('Saved OpenAPI spec to cache');
297 }
298
299 /**
300 * Fetch OpenAPI spec from remote with timeout

Callers 1

loadSpecMethod · 0.95

Calls 1

debugMethod · 0.80

Tested by

no test coverage detected