From 3b6bd7d222800472a3e146447f2dedcec2018f4d Mon Sep 17 00:00:00 2001 From: Yorick van Klinken Date: Tue, 11 Jun 2024 23:05:12 +0200 Subject: [PATCH] fix: removed invalid null as value from Random.shuffle() (#3095) Setting `null` on a variable of type `T` isn't valid in the eyes of TS --- src/engine/Math/Random.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/engine/Math/Random.ts b/src/engine/Math/Random.ts index bcc693610..b417f7e0b 100644 --- a/src/engine/Math/Random.ts +++ b/src/engine/Math/Random.ts @@ -205,7 +205,7 @@ export class Random { */ public shuffle(array: Array): Array { const tempArray = array.slice(0); - let swap: T = null; + let swap: T; for (let i = 0; i < tempArray.length - 2; i++) { const randomIndex = this.integer(i, tempArray.length - 1); swap = tempArray[i];