Merge pull request #13 from justmoon/fix/bytesRead-to-bytes

Fix typo bytesRead -> bytes
master
Chris Dickinson 8 years ago committed by GitHub
commit f04024540c

@ -10,10 +10,11 @@ function read(buf, offset) {
, counter = offset
, b
, l = buf.length
do {
if(counter >= l) {
read.bytesRead = 0
read.bytes = 0
read.bytesRead = 0 // DEPRECATED
return undefined
}
b = buf[counter++]
@ -22,8 +23,8 @@ function read(buf, offset) {
: (b & REST) * Math.pow(2, shift)
shift += 7
} while (b >= MSB)
read.bytes = counter - offset
return res
}

@ -126,6 +126,7 @@ test('buffer too short', function (assert) {
while(l--) {
var val = decode(buffer.slice(0, l))
assert.equal(val, undefined)
assert.equal(decode.bytes, 0)
assert.equal(decode.bytesRead, 0)
}
assert.end()

Loading…
Cancel
Save