mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-16 00:38:31 +01:00
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
|
||
|
}
|