feat: refactoring project
This commit is contained in:
6
node_modules/webpack/lib/CacheFacade.js
generated
vendored
6
node_modules/webpack/lib/CacheFacade.js
generated
vendored
@@ -38,6 +38,7 @@ class MultiItemCache {
|
||||
*/
|
||||
constructor(items) {
|
||||
this._items = items;
|
||||
// eslint-disable-next-line no-constructor-return
|
||||
if (items.length === 1) return /** @type {any} */ (items[0]);
|
||||
}
|
||||
|
||||
@@ -59,12 +60,11 @@ class MultiItemCache {
|
||||
* @param {number} i index
|
||||
* @returns {Promise<T>} promise with the data
|
||||
*/
|
||||
const next = i => {
|
||||
return this._items[i].getPromise().then(result => {
|
||||
const next = i =>
|
||||
this._items[i].getPromise().then(result => {
|
||||
if (result !== undefined) return result;
|
||||
if (++i < this._items.length) return next(i);
|
||||
});
|
||||
};
|
||||
return next(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user