node-gamedig/lib/ProtocolResolver.js
CosminPerRam 8192ed07e0
feat: export games and protocols besides GameDig (#411)
* feat: export games and protocols besides GameDig

* fix: revert ProtocolResolver rename

* fix: imports on the attempt tools

* docs: update changelog to note exports
2023-11-20 11:35:31 +02:00

8 lines
238 B
JavaScript

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]()
}