mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-10 21:26:56 +01:00
ce4cddb87f
* 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
18 lines
324 B
JavaScript
18 lines
324 B
JavaScript
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
|
|
}
|