refactor: add and use isValidCatalogLayout type guard for robust layout assignment
CI / check (push) Successful in 2m35s
CI / deploy (push) Successful in 1m19s
CI / publish-container (push) Successful in 50s

This commit is contained in:
openhands committed 2026-09-11 23:28:22 +02:00
1 parent 683fee3bd9
commit 669e20a35c
2 files changed
+13 -2

No files matched your search

+5
View File
@@ -23,6 +23,11 @@ export const CATALOG_LAYOUTS = [
export type CatalogLayout = (typeof CATALOG_LAYOUTS)[number];
/** Type guard to check if a string is a valid CatalogLayout. */
export function isValidCatalogLayout(layout: string): layout is CatalogLayout {
return (CATALOG_LAYOUTS as readonly string[]).includes(layout);
}
/** Short human-readable description for each layout. Shown in the layout selector. */
export const LAYOUT_DESCRIPTIONS: Record<CatalogLayout, string> = {
default_3x3: "Standard 3-column grid of items",