Files
ontime/packages/utils/src/rundown/rundown.utils.ts
T
Carlos Valente 2498e59156 refactor: migrate custom fields to transactions
refactor: extract functions to api domain

refactor: strict custom field parsing

refactor: remove rundown cache utilities

refactor: directory restructure
2025-06-09 14:12:59 +02:00

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];
}