mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 12:53:32 +00:00
refactor: gather group metadata
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user