retry-request
Advanced tools
Comparing version 1.2.4 to 1.3.0
@@ -8,2 +8,3 @@ 'use strict'; | ||
var DEFAULTS = { | ||
objectMode: false, | ||
request: request, | ||
@@ -26,2 +27,5 @@ retries: 2, | ||
if (typeof opts.objectMode === 'undefined') { | ||
opts.objectMode = DEFAULTS.objectMode; | ||
} | ||
if (typeof opts.request === 'undefined') { | ||
@@ -45,3 +49,3 @@ opts.request = DEFAULTS.request; | ||
var retryRequest = { | ||
abort: function() { | ||
abort: function () { | ||
if (activeRequest && activeRequest.abort) { | ||
@@ -54,3 +58,3 @@ activeRequest.abort(); | ||
if (streamMode) { | ||
retryStream = through(); | ||
retryStream = through({ objectMode: opts.objectMode }); | ||
retryStream.abort = resetStreams; | ||
@@ -57,0 +61,0 @@ } |
{ | ||
"name": "retry-request", | ||
"version": "1.2.4", | ||
"version": "1.3.0", | ||
"description": "Retry a request.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -43,2 +43,10 @@ |![retry-request](logo.png) | ||
#### `opts.objectMode` | ||
Type: `Boolean` | ||
Default: `false` | ||
Set to `true` if your custom `opts.request` function returns a stream in object mode. | ||
#### `opts.retries` | ||
@@ -88,2 +96,4 @@ | ||
*NOTE: If you override the request function, and it returns a stream in object mode, be sure to set `opts.objectMode` to `true`.* | ||
```js | ||
@@ -90,0 +100,0 @@ var originalRequest = require('request').defaults({ |
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
7466
107
118