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