mirror of
https://github.com/tribufu/node-gamedig
synced 2026-06-01 09:42:41 +00:00
feat: remove games.txt and replace it with an in-code solution (#407)
* feat: remove games.txt and replace it with an in-code solution * docs: update changelog * chore: add todo comment regarding weird game ids to rename * fix: generate games list md file * fix: gemerate games list file to alphabetical id order * fix: update changelog to note removal of some game ids and add geneshift alternative
This commit is contained in:
parent
2fb9f507e2
commit
ce4cddb87f
7 changed files with 2456 additions and 468 deletions
17
lib/game-resolver.js
Normal file
17
lib/game-resolver.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { games } from './games.js'
|
||||
|
||||
export const lookup = (type) => {
|
||||
if (!type) { throw Error('No game specified') }
|
||||
|
||||
if (type.startsWith('protocol-')) {
|
||||
return {
|
||||
protocol: type.substring(9)
|
||||
}
|
||||
}
|
||||
|
||||
const game = games[type]
|
||||
|
||||
if (!game) { throw Error('Invalid game: ' + type) }
|
||||
|
||||
return game.options
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue