MCPcopy Create free account
hub / github.com/webpack/less-loader / resolveRequests

Method resolveRequests

src/utils.js:198–218  ·  view source on GitHub ↗

* @param {string} context context * @param {string[]} possibleRequests possible requests * @returns {Promise } resolved requests

(context, possibleRequests)

Source from the content-addressed store, hash-verified

196 * @returns {Promise<string>} resolved requests
197 */
198 async resolveRequests(context, possibleRequests) {
199 if (possibleRequests.length === 0) {
200 throw new Error("No possible requests to resolve");
201 }
202
203 let result;
204
205 try {
206 result = await resolve(context, possibleRequests[0]);
207 } catch (error) {
208 const [, ...tailPossibleRequests] = possibleRequests;
209
210 if (tailPossibleRequests.length === 0) {
211 throw error;
212 }
213
214 result = await this.resolveRequests(context, tailPossibleRequests);
215 }
216
217 return result;
218 }
219
220 /**
221 * @param {string} filename filename

Callers 1

resolveFilenameMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected