@rinq/websocket
Version:
Rinq in the browser.
12 lines (9 loc) • 508 B
JavaScript
module.exports = function unmarshalCallAsync (header) {
var namespace = header[0]
var command = header[1]
var timeout = header[2]
if (typeof namespace !== 'string') throw new Error('Invalid CALL_ASYNC message header (namespace).')
if (typeof command !== 'string') throw new Error('Invalid CALL_ASYNC message header (command).')
if (!Number.isInteger(timeout)) throw new Error('Invalid CALL_ASYNC message header (timeout).')
return {namespace: namespace, command: command, timeout: timeout}
}