mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
[bugfix] Steam and Oculus are not at the top of the versions list
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user