mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-20 12:55:26 +02:00
Get rid of switch statements in favor of an EventEmitter-based router for message handling.
This commit is contained in:
@@ -2,5 +2,15 @@ var path = require('path')
|
||||
|
||||
var ProtoBuf = require('protobufjs')
|
||||
|
||||
module.exports =
|
||||
ProtoBuf.loadProtoFile(path.join(__dirname, 'wire.proto')).build()
|
||||
var wire = ProtoBuf.loadProtoFile(path.join(__dirname, 'wire.proto')).build()
|
||||
|
||||
wire.ReverseMessageType = Object.keys(wire.MessageType)
|
||||
.reduce(
|
||||
function(acc, type) {
|
||||
acc[wire.MessageType[type]] = type
|
||||
return acc
|
||||
}
|
||||
, Object.create(null)
|
||||
)
|
||||
|
||||
module.exports = wire
|
||||
|
||||
Reference in New Issue
Block a user