node-gamedig/lib/ProtocolResolver.js

8 lines
245 B
JavaScript
Raw Normal View History

import * as Protocols from '../protocols/index.js'
export const getProtocol = (protocolId) => {
if (!(protocolId in Protocols)) { throw Error('Protocol definition file missing: ' + protocolId) }
return new Protocols[protocolId]()
}