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