Comparing version 0.4.0 to 0.4.1
@@ -61,10 +61,12 @@ 'use strict'; | ||
reqOptions.controller.abort = function () { | ||
req.abort(); | ||
var err = new Error('Aborted'); | ||
err.name = 'aborted'; | ||
deferred.reject(err); | ||
}; | ||
if (reqOptions.controller) { | ||
reqOptions.controller.abort = function () { | ||
req.abort(); | ||
var err = new Error('Aborted'); | ||
err.name = 'aborted'; | ||
deferred.reject(err); | ||
}; | ||
} | ||
return deferred.promise; | ||
} |
@@ -91,7 +91,9 @@ 'use strict' | ||
reqOptions.controller.abort = function () { | ||
req.abort() | ||
const err = new Error('Aborted') | ||
err.name = 'aborted' | ||
deferred.reject(err) | ||
if (reqOptions.controller) { | ||
reqOptions.controller.abort = function () { | ||
req.abort() | ||
const err = new Error('Aborted') | ||
err.name = 'aborted' | ||
deferred.reject(err) | ||
} | ||
} | ||
@@ -98,0 +100,0 @@ |
{ | ||
"name": "req-then", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "Simple http(s) request function, returning a promise. ", | ||
@@ -6,0 +6,0 @@ "repository": "https://github.com/75lb/req-then", |
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
11757
209