New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

rpcinterface

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rpcinterface - npm Package Compare versions

Comparing version
0.0.11
to
0.1.0
+3
-0
CHANGELOG.md
## Changelog ##
### 0.1.0 ###
* Exceptions throw in handler will now correctly throw if using promise in preProcessor
### 0.0.11 ###

@@ -4,0 +7,0 @@ * `array` type is now enforced (`object` still continue to match arrays and objects)

+1
-1
{
"name": "rpcinterface",
"version": "0.0.11",
"version": "0.1.0",
"description": "Library that facilitates an RPC interface in a webapp or node app",

@@ -5,0 +5,0 @@ "main": "node-index.js",

@@ -42,3 +42,3 @@ # rpcinterface #

### rpc.call(method, params) ###
### rpc.call(method[, params]) ###

@@ -45,0 +45,0 @@ Calls a method added by `addMethod` and sends along the passed params. Returns a

+2
-2

@@ -113,4 +113,4 @@ var _EMPTY_OBJECT_ = {},

preDfd = this.preProcessor(method, parameters, dfd);
if (preDfd && typeof preDfd.then === 'function') {
preDfd.then(function() {
if (preDfd && typeof preDfd.done === 'function') {
preDfd[typeof dfd.done === 'function' ? 'done' : 'then'](function() {
if (deferredPending(dfd)) {

@@ -117,0 +117,0 @@ return;

@@ -250,1 +250,35 @@ var Deferred = require('deferred'),

};
exports.callTestResolveNull = function(test) {
test.expect(1);
var rpc = new RPCInterface();
rpc.addMethod('test', {
handler: function(params, dfd) {
dfd.resolve(null);
},
params: {
test: {type: 'array', optional: false}
}
});
rpc.call('test', {test: []}).then(function(result) {
test.strictEqual(result, null);
test.done();
});
};
exports.callTestResolveUndefined = function(test) {
test.expect(1);
var rpc = new RPCInterface();
rpc.addMethod('test', {
handler: function(params, dfd) {
dfd.resolve();
},
params: {
test: {type: 'array', optional: false}
}
});
rpc.call('test', {test: []}).then(function(result) {
test.strictEqual(result, undefined);
test.done();
});
};