2023-11-20 10:35:31 +01:00
|
|
|
import * as protocols from '../protocols/index.js'
|
2023-11-12 12:14:43 +01:00
|
|
|
|
|
|
|
export const getProtocol = (protocolId) => {
|
2023-11-20 10:35:31 +01:00
|
|
|
if (!(protocolId in protocols)) { throw Error('Protocol definition file missing: ' + protocolId) }
|
2023-11-12 12:14:43 +01:00
|
|
|
|
2023-11-20 10:35:31 +01:00
|
|
|
return new protocols[protocolId]()
|
2023-11-12 12:14:43 +01:00
|
|
|
}
|