mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 14:14:17 +00:00
2498e59156
refactor: extract functions to api domain refactor: strict custom field parsing refactor: remove rundown cache utilities refactor: directory restructure
16 lines
417 B
TypeScript
16 lines
417 B
TypeScript
import type { ProjectRundowns, Rundown } from 'ontime-types';
|
|
|
|
/**
|
|
* Gets the first rundown in the project
|
|
* We know that the project has at least one rundown
|
|
*/
|
|
export function getFirstRundown(rundowns: ProjectRundowns): Rundown {
|
|
const keys = Object.keys(rundowns);
|
|
if (keys.length === 0) {
|
|
throw new Error('No rundowns found in project');
|
|
}
|
|
|
|
const firstKey = keys[0];
|
|
return rundowns[firstKey];
|
|
}
|