From 9b692dca1e9ca8e83a354782ca4b24704c5560e1 Mon Sep 17 00:00:00 2001 From: Mihovil Ilakovac Date: Thu, 31 Oct 2024 23:41:28 +0100 Subject: [PATCH] Testing out the cached build --- src/tasks/queries.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tasks/queries.ts b/src/tasks/queries.ts index fd18882..f0835cc 100644 --- a/src/tasks/queries.ts +++ b/src/tasks/queries.ts @@ -13,7 +13,14 @@ export const getTasks = (async (_args, context) => { orderBy: { id: "asc" }, }); return tasks.map((task) => { - task.description = task.description.toUpperCase(); + task.description = toEveryOtherUppercase(task.description); return task; }); }) satisfies GetTasks; + +function toEveryOtherUppercase(str: string): string { + return str + .split("") + .map((char, index) => (index % 2 === 0 ? char.toUpperCase() : char)) + .join(""); +}