Comparing version 0.8.10 to 1.0.0
@@ -83,3 +83,7 @@ /* | ||
json?: boolean, | ||
preserveBuffers?: boolean | ||
preserveBuffers?: boolean, | ||
token?: string, | ||
pingInterval?: number, | ||
maxPingOut?: number, | ||
useOldRequestStyle?: boolean | ||
} | ||
@@ -86,0 +90,0 @@ |
@@ -32,3 +32,3 @@ /* | ||
*/ | ||
var VERSION = '0.8.10', | ||
var VERSION = '1.0.0', | ||
@@ -83,3 +83,3 @@ DEFAULT_PORT = 4222, | ||
BAD_JSON = 'BAD_JSON', | ||
BAD_JSON_MSG = 'Message should be a JSON object', | ||
BAD_JSON_MSG = 'Message should be a non-circular JSON-serializable value', | ||
BAD_MSG = 'BAD_MSG', | ||
@@ -620,3 +620,3 @@ BAD_MSG_MSG = 'Message can\'t be a function', | ||
this.stream.removeAllListeners(); | ||
this.stream.end(); | ||
this.stream.destroy(); | ||
} | ||
@@ -674,3 +674,2 @@ // Create the stream | ||
if (this.stream !== null) { | ||
this.stream.end(); | ||
this.stream.destroy(); | ||
@@ -898,3 +897,2 @@ this.stream = null; | ||
client.stream.removeAllListeners(); | ||
client.stream.end(); | ||
} | ||
@@ -1176,5 +1174,10 @@ client.stream = tls.connect(tlsOpts, function() { | ||
} | ||
if (!msg) { | ||
msg = EMPTY; | ||
if (!this.options.json) { | ||
msg = msg || EMPTY; | ||
} else { | ||
// undefined is not a valid JSON-serializable value, but null is | ||
msg = msg === undefined ? null : msg; | ||
} | ||
if (!subject) { | ||
@@ -1217,5 +1220,2 @@ if (opt_callback) { | ||
if (this.options.json) { | ||
if (typeof msg !== 'object') { | ||
throw (new NatsError(BAD_JSON_MSG, BAD_JSON)); | ||
} | ||
try { | ||
@@ -1229,3 +1229,3 @@ str = JSON.stringify(msg); | ||
} else { | ||
var b = new Buffer(psub.length + msg.length + (2 * CR_LF_LEN) + msg.length.toString().length); | ||
var b = Buffer.allocUnsafe(psub.length + msg.length + (2 * CR_LF_LEN) + msg.length.toString().length); | ||
var len = b.write(psub + msg.length + CR_LF); | ||
@@ -1232,0 +1232,0 @@ msg.copy(b, len); |
{ | ||
"name": "nats", | ||
"version": "0.8.10", | ||
"version": "1.0.0", | ||
"description": "Node.js client for NATS, a lightweight, high-performance cloud native messaging system", | ||
@@ -41,6 +41,6 @@ "keywords": [ | ||
"engines": { | ||
"node": ">= 0.10.x <10.0.0" | ||
"node": ">= 4.5.0" | ||
}, | ||
"dependencies": { | ||
"nuid": "^0.6.14" | ||
"nuid": "^1.0.0" | ||
}, | ||
@@ -47,0 +47,0 @@ "devDependencies": { |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
81415
1686
0
+ Addednuid@1.1.6(transitive)
- Removednuid@0.6.14(transitive)
Updatednuid@^1.0.0