Pass empty params as null (#115)

This commit is contained in:
Jaco Greeff
2018-07-22 12:12:37 +02:00
committed by GitHub
parent 6d8ab1b4b9
commit b60a3f3cc0
6 changed files with 66 additions and 64 deletions
@@ -10,6 +10,8 @@ export default function encodeObject (self: RpcCoderState, method: string, param
id: ++self.id,
jsonrpc: '2.0',
method,
params
params: params && params.length
? params
: null
};
}
+1 -1
View File
@@ -9,7 +9,7 @@ export type JsonRpcObject = {
export type JsonRpcRequest = JsonRpcObject & {
method: string;
params: Array<any>;
params: Array<any> | null;
};
export type JsonRpcResponseBase$Error = {