mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -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,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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue