refactor: gather group metadata

This commit is contained in:
Carlos Valente
2025-03-28 19:16:38 +01:00
committed by Carlos Valente
parent 730cb95c04
commit 876d111c61
48 changed files with 1044 additions and 751 deletions
@@ -1,19 +1,5 @@
import type { MaybeString } from 'ontime-types';
import { EndAction, TimerType, TimeStrategy } from 'ontime-types';
/**
* Check if a given value is a valid type linkStart, returns the fallback otherwise
* linkStart can be a string (id of an event to link) or null (unlinked)
* @param {MaybeString} maybeLinkStart
* @returns {MaybeString}
*/
export function validateLinkStart(maybeLinkStart: unknown, fallback: MaybeString = null): MaybeString {
if (typeof maybeLinkStart === 'string' || maybeLinkStart === null) {
return maybeLinkStart as MaybeString;
}
return fallback;
}
/**
* Check if a given value is a valid time strategy, returns the fallback otherwise
* @param {TimeStrategy} maybeTimeStrategy