libkernel
Advanced tools
Comparing version 0.0.39 to 0.0.40
@@ -57,14 +57,14 @@ // log provides a wrapper for console.log that prefixes 'libkernel'. | ||
// resolve/reject the promise associated with the nonce. | ||
function handleKernelResponse(event, promise) { | ||
function handleKernelResponse(data, promise) { | ||
// Check that the response is well formed. | ||
if (!("response" in event.data) || !("err" in event.data)) { | ||
logErr("received a malformed bridgeToKernelResponse\n", event.data); | ||
promise.reject("received a malformed bridgeToKernelResponse: " + JSON.stringify(event.data)); | ||
if (!("response" in data) || !("err" in data)) { | ||
logErr("received a malformed bridgeToKernelResponse\n", data); | ||
promise.reject("received a malformed bridgeToKernelResponse: " + JSON.stringify(data)); | ||
return; | ||
} | ||
if (event.data.response !== null) { | ||
promise.resolve(event.data.response); | ||
if (data.response !== null) { | ||
promise.resolve(data.response); | ||
return; | ||
} | ||
promise.reject(event.data.err); | ||
promise.reject(data.err); | ||
} | ||
@@ -71,0 +71,0 @@ // handleMessage will handle a message from the kernel, using the response to |
{ | ||
"name": "libkernel", | ||
"version": "0.0.39", | ||
"version": "0.0.40", | ||
"description": "helper library to interact with the skynet kernel", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
11394