[bugfix] Steam and Oculus are not at the top of the versions list

This commit is contained in:
MathieuG-P
2023-09-20 17:32:45 +02:00
parent d8a4889298
commit 34936f6666
3 changed files with 24 additions and 14 deletions
+8
View File
@@ -10,3 +10,11 @@ export function swapElements<T = unknown>(from: number, to: number, arr: T[]): T
[arr[from], arr[to]] = [arr[to], arr[from]];
return arr;
}
export function popElement<T = unknown>(func: (element: T) => boolean, arr: T[]): T {
const index = arr.findIndex(func);
if (index === -1) {
return null;
}
return arr.splice(index, 1)[0];
}