node-gamedig/lib/ProtocolResolver.js

9 lines
245 B
JavaScript
Raw Normal View History

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