UNPKG

@rinq/websocket

Version:
10 lines (7 loc) 358 B
module.exports = function unmarshalExecute (header) { var namespace = header[0] var command = header[1] if (typeof namespace !== 'string') throw new Error('Invalid EXECUTE message header (namespace).') if (typeof command !== 'string') throw new Error('Invalid EXECUTE message header (command).') return {namespace: namespace, command: command} }