From c1c1dda04a2d87c256b6f28f258f00590ecd28f4 Mon Sep 17 00:00:00 2001 From: Artemy Egorov Date: Sun, 27 Aug 2023 18:18:31 +0300 Subject: [PATCH] refactor: if statement --- packages/prompts/src/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/prompts/src/index.ts b/packages/prompts/src/index.ts index 254dcf83..4a764f32 100644 --- a/packages/prompts/src/index.ts +++ b/packages/prompts/src/index.ts @@ -781,11 +781,11 @@ export type Task = { */ export const tasks = async (tasks: Task[]) => { for (const task of tasks) { - if (task.enabled !== false) { - const s = spinner(); - s.start(task.title); - const result = await task.task(s.message); - s.stop(result || task.title); - } + if (task.enabled === false) continue; + + const s = spinner(); + s.start(task.title); + const result = await task.task(s.message); + s.stop(result || task.title); } };