Skip to content

Commit

Permalink
refactor: code
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Aug 15, 2024
1 parent 76d8530 commit 3a0f984
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,9 @@ function wrapper(context) {
headers = allHeaders;
}

headers.forEach((header) => {
setResponseHeader(res, header.key, header.value);
});
for (const { key, value } of headers) {
setResponseHeader(res, key, value);
}
}

if (
Expand Down
1 change: 0 additions & 1 deletion src/utils/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ function ready(context, callback, req) {
const name = (req && req.url) || callback.name;

context.logger.info(`wait until bundle finished${name ? `: ${name}` : ""}`);

context.callbacks.push(callback);
}

Expand Down
11 changes: 3 additions & 8 deletions src/utils/setupHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,9 @@ function setupHooks(context) {
context.callbacks = [];

// Execute callback that are delayed
callbacks.forEach(
/**
* @param {(...args: any[]) => Stats | MultiStats} callback
*/
(callback) => {
callback(stats);
},
);
for (const callback of callbacks) {
callback(stats);
}
});
}

Expand Down

0 comments on commit 3a0f984

Please sign in to comment.