Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
infloent committed Nov 6, 2024
1 parent 2186821 commit 0aac6f8
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions scripts/libs.js
Original file line number Diff line number Diff line change
Expand Up @@ -698,12 +698,8 @@ export const previewModule = async (path, name) => {
};

export function yieldToMain() {
return new Promise((resolve, reject) => {
try {
setTimeout(resolve, 0);
} catch (error) {
reject();
}
return new Promise((resolve) => {
setTimeout(resolve, 0);
});
}

Expand Down Expand Up @@ -733,13 +729,9 @@ export async function runTasks(params, ...taskList) {

// Run the task:
let result = null;
try {
// eslint-disable-next-line no-await-in-loop
result = await task.call(this, prevResults, i);
} catch (error) {
// eslint-disable-next-line no-console
console.error(error);
}
// eslint-disable-next-line no-await-in-loop
result = await task.call(this, prevResults, i);

if (!task.name.length) {
// eslint-disable-next-line no-console
console.warn("The task doesn't have a name. Please use a named function to create the task.");
Expand Down

0 comments on commit 0aac6f8

Please sign in to comment.