Comparing version 2.1.6 to 2.1.7
@@ -0,1 +1,7 @@ | ||
2.1.7 / 2016-06-19 | ||
================== | ||
* deps: bytes@2.4.0 | ||
* perf: remove double-cleanup on happy path | ||
2.1.6 / 2016-03-07 | ||
@@ -2,0 +8,0 @@ ================== |
27
index.js
@@ -40,3 +40,3 @@ /*! | ||
function getDecoder(encoding) { | ||
function getDecoder (encoding) { | ||
if (!encoding) return null | ||
@@ -66,3 +66,3 @@ | ||
function getRawBody(stream, options, callback) { | ||
function getRawBody (stream, options, callback) { | ||
var done = callback | ||
@@ -111,4 +111,4 @@ var opts = options || {} | ||
return new Promise(function executor(resolve, reject) { | ||
readStream(stream, encoding, length, limit, function onRead(err, buf) { | ||
return new Promise(function executor (resolve, reject) { | ||
readStream(stream, encoding, length, limit, function onRead (err, buf) { | ||
if (err) return reject(err) | ||
@@ -127,3 +127,3 @@ resolve(buf) | ||
function halt(stream) { | ||
function halt (stream) { | ||
// unpipe everything from the stream | ||
@@ -152,3 +152,3 @@ unpipe(stream) | ||
function createError(status, message, type, props) { | ||
function createError (status, message, type, props) { | ||
var error = new Error() | ||
@@ -193,3 +193,3 @@ | ||
function readStream(stream, encoding, length, limit, callback) { | ||
function readStream (stream, encoding, length, limit, callback) { | ||
var complete = false | ||
@@ -243,3 +243,3 @@ var sync = true | ||
function done() { | ||
function done () { | ||
var args = new Array(arguments.length) | ||
@@ -261,3 +261,3 @@ | ||
function invokeCallback() { | ||
function invokeCallback () { | ||
cleanup() | ||
@@ -274,3 +274,3 @@ | ||
function onAborted() { | ||
function onAborted () { | ||
if (complete) return | ||
@@ -286,3 +286,3 @@ | ||
function onData(chunk) { | ||
function onData (chunk) { | ||
if (complete) return | ||
@@ -303,3 +303,3 @@ | ||
function onEnd(err) { | ||
function onEnd (err) { | ||
if (complete) return | ||
@@ -318,3 +318,2 @@ if (err) return done(err) | ||
: Buffer.concat(buffer) | ||
cleanup() | ||
done(null, string) | ||
@@ -324,3 +323,3 @@ } | ||
function cleanup() { | ||
function cleanup () { | ||
buffer = null | ||
@@ -327,0 +326,0 @@ |
{ | ||
"name": "raw-body", | ||
"description": "Get and validate the raw body of a readable stream.", | ||
"version": "2.1.6", | ||
"version": "2.1.7", | ||
"author": "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)", | ||
@@ -13,3 +13,3 @@ "contributors": [ | ||
"dependencies": { | ||
"bytes": "2.3.0", | ||
"bytes": "2.4.0", | ||
"iconv-lite": "0.4.13", | ||
@@ -19,6 +19,10 @@ "unpipe": "1.0.0" | ||
"devDependencies": { | ||
"bluebird": "3.3.4", | ||
"istanbul": "0.4.2", | ||
"mocha": "2.4.5", | ||
"readable-stream": "2.0.5", | ||
"bluebird": "3.4.1", | ||
"eslint": "2.13.0", | ||
"eslint-config-standard": "5.3.1", | ||
"eslint-plugin-promise": "1.3.2", | ||
"eslint-plugin-standard": "1.3.2", | ||
"istanbul": "0.4.3", | ||
"mocha": "2.5.3", | ||
"readable-stream": "2.1.2", | ||
"through2": "2.0.1" | ||
@@ -36,2 +40,3 @@ }, | ||
"scripts": { | ||
"lint": "eslint **/*.js", | ||
"test": "mocha --trace-deprecation --reporter spec --bail --check-leaks test/", | ||
@@ -38,0 +43,0 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --trace-deprecation --reporter dot --check-leaks test/", |
@@ -25,3 +25,3 @@ # raw-body | ||
- `length` - The length length of the stream. | ||
- `length` - The length of the stream. | ||
If the contents of the stream do not add up to this length, | ||
@@ -28,0 +28,0 @@ an `400` error code is returned. |
Sorry, the diff of this file is not supported yet
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
16979
9
262
+ Addedbytes@2.4.0(transitive)
- Removedbytes@2.3.0(transitive)
Updatedbytes@2.4.0