feat: add game type alias
This commit is contained in:
parent
6746442254
commit
cebefe3899
|
@ -9,7 +9,11 @@ export const lookup = (type) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const game = games[type]
|
let game = games[type]
|
||||||
|
|
||||||
|
Object.keys(games).forEach((id) => {
|
||||||
|
if (games[id].alias) game = games[id]
|
||||||
|
})
|
||||||
|
|
||||||
if (!game) { throw Error('Invalid game: ' + type) }
|
if (!game) { throw Error('Invalid game: ' + type) }
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,16 @@ sortedGamesIds.forEach(key => {
|
||||||
})
|
})
|
||||||
|
|
||||||
let generated = ''
|
let generated = ''
|
||||||
generated += '| GameDig Type ID | Name | See Also\n'
|
generated += '| GameDig Type ID | Alias | Name | See Also\n'
|
||||||
generated += '|---|---|---\n'
|
generated += '|---|---|---|---\n'
|
||||||
|
|
||||||
for (const id in sortedGames) {
|
for (const id in sortedGames) {
|
||||||
const game = sortedGames[id]
|
const game = sortedGames[id]
|
||||||
generated += '| ' + id.padEnd(10, ' ') + ' | ' + game.name
|
if (!game.alias) {
|
||||||
|
game.alias = ' '
|
||||||
|
}
|
||||||
|
generated += '| ' + id.padEnd(10, ' ') + ' | ' + game.alias + ' | ' + game.name
|
||||||
|
|
||||||
const notes = []
|
const notes = []
|
||||||
if (game?.extra?.doc_notes) {
|
if (game?.extra?.doc_notes) {
|
||||||
notes.push('[Notes](#' + game.extra.doc_notes + ')')
|
notes.push('[Notes](#' + game.extra.doc_notes + ')')
|
||||||
|
|
Loading…
Reference in New Issue