json-wire-protocol
Advanced tools
Comparing version 0.1.3 to 0.2.0
@@ -0,1 +1,4 @@ | ||
# 0.2.0 | ||
- expose separator constant value. | ||
# 0.1.0 | ||
@@ -2,0 +5,0 @@ - browser support ( intended for xpcshell primarily though ) |
(function(global, exports) { | ||
var HAS_BUFFER = typeof Buffer !== 'undefined'; | ||
var SEPERATOR_CODE = 58; // UTF8 / ASCII value for : | ||
var SEPERATOR = ':'; | ||
var SEPARATOR = ':'; | ||
var SEPARATOR_CODE = SEPARATOR.charCodeAt(0); | ||
var EventEmitter = | ||
@@ -31,3 +31,3 @@ global.EventEmitter2 || | ||
do { | ||
if (buffer[index] === SEPERATOR_CODE) | ||
if (buffer[index] === SEPARATOR_CODE) | ||
return index; | ||
@@ -132,3 +132,3 @@ | ||
return len + SEPERATOR + json; | ||
return len + SEPARATOR + json; | ||
} | ||
@@ -176,3 +176,3 @@ | ||
if (this._pendingLength === null) { | ||
var idx = indexInBuffer(this._buffer, SEPERATOR); | ||
var idx = indexInBuffer(this._buffer, SEPARATOR); | ||
if (idx === -1) | ||
@@ -233,2 +233,3 @@ return; | ||
exports.Stream = Stream; | ||
exports.separator = SEPARATOR; | ||
}).apply( | ||
@@ -235,0 +236,0 @@ null, |
{ | ||
"name": "json-wire-protocol", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "description": "JSON wire protocol parser/writer (used in mozilla debugger protocol)", |
@@ -16,2 +16,6 @@ suite('json wire protocol', function() { | ||
test('.separator', function() { | ||
assert.ok(jsonWireProtocol.separator); | ||
}); | ||
suite('#stringify', function() { | ||
@@ -18,0 +22,0 @@ test('ASCII only', function() { |
58329
1668