mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Keep categoryToKind in object
This commit is contained in:
parent
91ed68e236
commit
29668409f8
1 changed files with 9 additions and 7 deletions
|
|
@ -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
|
||||
export function getCategoryKindName ( categorySlug ) {
|
||||
if ( categorySlug === 'homebrew' ) {
|
||||
return 'formula'
|
||||
}
|
||||
|
||||
if ( categorySlug === 'games' ) {
|
||||
return 'game'
|
||||
}
|
||||
return categoryToKind[ categorySlug ]
|
||||
}
|
||||
|
||||
return categories[ categorySlug ].slug
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue