Keep categoryToKind in object

This commit is contained in:
Sam Carlton 2022-06-03 16:16:59 -05:00
parent 91ed68e236
commit 29668409f8

View file

@ -201,15 +201,17 @@ export const categories = {
}, },
} }
// Maps categories to kinds and vice versa
const categoryToKind = {
...Object.fromEntries( Object.keys( categories ).map( key => [ key, key ] ) ),
'homebrew': 'formula',
'games': 'game',
}
// Respective directory for each category // Respective directory for each category
export function getCategoryKindName ( categorySlug ) { export function getCategoryKindName ( categorySlug ) {
if ( categorySlug === 'homebrew' ) { return categoryToKind[ categorySlug ]
return 'formula' }
}
if ( categorySlug === 'games' ) {
return 'game'
}
return categories[ categorySlug ].slug return categories[ categorySlug ].slug
} }