AI Implementation feature(883): Admin Area General Settings and Categories 1.01 (#23)
This commit was merged in pull request #23.
This commit is contained in:
@@ -1,3 +1,16 @@
|
||||
export type PageTitleError = 'required' | 'maxlength' | null;
|
||||
|
||||
export function pageTitleError(value: string | null | undefined, maxLength = 120): PageTitleError {
|
||||
const v = value ?? '';
|
||||
if (v.trim().length === 0) return 'required';
|
||||
if (v.length > maxLength) return 'maxlength';
|
||||
return null;
|
||||
}
|
||||
|
||||
export function normalizePageTitle(value: string): string {
|
||||
return value.trim();
|
||||
}
|
||||
|
||||
export type EventDerivedState = 'running' | 'countdown' | 'stopped' | 'unconfigured';
|
||||
|
||||
export function deriveEventState(start: string, end: string): EventDerivedState {
|
||||
|
||||
Reference in New Issue
Block a user