enniot-device-sdk
Advanced tools
Comparing version 0.0.15 to 0.0.16
{ | ||
"name": "enniot-device-sdk", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,12 +14,16 @@ const net = require('net'); | ||
socket.on('data', data => { | ||
const resStr = data.slice(2).toString(); | ||
const res = JSON.parse(resStr); | ||
try { | ||
const resStr = data.slice(2).toString(); | ||
const res = JSON.parse(resStr); | ||
const { result, content } = res; | ||
if(!result.status) { | ||
reject(new Error(result.retDesc)); | ||
} else { | ||
resolve(content); | ||
const { result, content } = res; | ||
if(!result.status) { | ||
reject(new Error(result.retDesc)); | ||
} else { | ||
resolve(content); | ||
} | ||
socket.destroy(); | ||
} catch(err) { | ||
reject(err) | ||
} | ||
socket.destroy(); | ||
}); | ||
@@ -26,0 +30,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10649
369