MCPcopy
hub / github.com/webpack/webpack / providePromise

Method providePromise

lib/CacheFacade.js:205–211  ·  view source on GitHub ↗

* Returns promise with the data. * @template T * @param {() => Promise<T> | T} computer function to compute the value if not cached * @returns {Promise<T>} promise with the data

(computer)

Source from the content-addressed store, hash-verified

203 * @returns {Promise<T>} promise with the data
204 */
205 async providePromise(computer) {
206 const cacheEntry = await this.getPromise();
207 if (cacheEntry !== undefined) return cacheEntry;
208 const result = await computer();
209 await this.storePromise(result);
210 return result;
211 }
212}
213
214class CacheFacade {

Callers

nothing calls this directly

Calls 2

getPromiseMethod · 0.95
storePromiseMethod · 0.95

Tested by

no test coverage detected