From 1289e81971be72dc87150b517a8aa400ba0a03cf Mon Sep 17 00:00:00 2001 From: Dominic Go <18517029+dominicstop@users.noreply.github.com> Date: Sat, 22 Apr 2023 09:22:34 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AB=20Update:=20Ex=20-=20`Helpers`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/src/functions/Helpers.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/example/src/functions/Helpers.ts b/example/src/functions/Helpers.ts index ce9cc7f9..d9f1d22e 100644 --- a/example/src/functions/Helpers.ts +++ b/example/src/functions/Helpers.ts @@ -90,3 +90,7 @@ export function promiseWithTimeout(ms: number, promise: Promise) { export function pad(num: number | string, places = 2) { return String(num).padStart(places, '0'); } + +export function getNextItemInCyclicArray(index: number, array: Array): T { + return array[index % array.length]; +} \ No newline at end of file