teeny-request
Advanced tools
Comparing version 3.11.2 to 3.11.3
@@ -8,3 +8,3 @@ "use strict"; | ||
return extendStatics(d, b); | ||
}; | ||
} | ||
return function (d, b) { | ||
@@ -85,9 +85,9 @@ extendStatics(d, b); | ||
function fetchToRequestResponse(opts, res) { | ||
var request = res.body; | ||
var request = {}; | ||
request.headers = opts.headers || {}; | ||
request.href = res.url; | ||
// headers need to be converted from a map to an obj | ||
var headers = {}; | ||
res.headers.forEach(function (value, key) { return headers[key] = value; }); | ||
return { | ||
var resHeaders = {}; | ||
res.headers.forEach(function (value, key) { return resHeaders[key] = value; }); | ||
var response = Object.assign(res.body, { | ||
statusCode: res.status, | ||
@@ -97,4 +97,6 @@ statusMessage: res.statusText, | ||
body: res.body, | ||
headers: headers, | ||
}; | ||
headers: resHeaders, | ||
toJSON: function () { return ({ headers: resHeaders }); }, | ||
}); | ||
return response; | ||
} | ||
@@ -101,0 +103,0 @@ /** |
{ | ||
"name": "teeny-request", | ||
"version": "3.11.2", | ||
"version": "3.11.3", | ||
"description": "Like request, but smaller.", | ||
@@ -5,0 +5,0 @@ "main": "./build/src/index.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
32563
253
2