mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 19:03:47 +00:00
refactor: restructure model to contain an object of rundowns
This commit is contained in:
@@ -36,11 +36,8 @@ export function deleteAtIndex<T>(index: number, array: T[]) {
|
||||
|
||||
/**
|
||||
* Reorders two objects in an array
|
||||
* @param array
|
||||
* @param fromIndex
|
||||
* @param toIndex
|
||||
*/
|
||||
export function reorderArray<T>(array: T[], fromIndex: number, toIndex: number) {
|
||||
export function reorderArray<T>(array: T[], fromIndex: number, toIndex: number): T[] {
|
||||
if (fromIndex === toIndex) {
|
||||
return array; // No change needed, return the original array
|
||||
}
|
||||
|
||||
@@ -16,3 +16,7 @@ export function getPropertyFromPath<T extends object>(path: string, obj: T): unk
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
export function isObjectEmpty(obj: object): boolean {
|
||||
return Object.keys(obj).length === 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user