mirror of
https://github.com/Matysh/houseplan-card
synced 2026-09-29 03:09:36 +00:00
14 lines
526 B
TypeScript
14 lines
526 B
TypeScript
export interface CardEditorSpaceOption { value: string; label: string }
|
|
|
|
/** Missing persisted default_floor, but only after an authoritative load. */
|
|
export function invalidDefaultFloor(
|
|
config: any,
|
|
spaces: readonly CardEditorSpaceOption[] | null,
|
|
authoritative: boolean,
|
|
): string | null {
|
|
if (!authoritative || spaces === null) return null;
|
|
const raw = typeof config?.default_floor === 'string' ? config.default_floor : '';
|
|
if (!raw || spaces.some((space) => space.value === raw)) return null;
|
|
return raw;
|
|
}
|