bare-rpc 0.2.4 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -10,7 +10,7 @@ const OutgoingStream = require('./lib/outgoing-stream')
10
10
  const CommandRouter = require('./lib/command-router')
11
11
 
12
12
  module.exports = exports = class RPC {
13
- constructor(stream, onrequest) {
13
+ constructor(stream, onrequest = noop) {
14
14
  this._stream = stream
15
15
 
16
16
  this._id = 0
@@ -404,3 +404,5 @@ module.exports = exports = class RPC {
404
404
  }
405
405
 
406
406
  exports.CommandRouter = CommandRouter
407
+
408
+ function noop() {}
@@ -38,7 +38,7 @@ module.exports = class RPCCommandRouter {
38
38
 
39
39
  if (requestEncoding) data = c.decode(requestEncoding, data)
40
40
 
41
- data = await onrequest(req, req.data)
41
+ data = await onrequest(req, data)
42
42
 
43
43
  if (req.sent) return
44
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-rpc",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "librpc ABI compatible RPC for Bare",
5
5
  "exports": {
6
6
  ".": {