Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

got

Package Overview
Dependencies
Maintainers
5
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

got - npm Package Compare versions

Comparing version 9.2.0 to 9.2.1

15

package.json
{
"name": "got",
"version": "9.2.0",
"version": "9.2.1",
"description": "Simplified HTTP requests",

@@ -12,4 +12,3 @@ "license": "MIT",

"scripts": {
"test": "xo && nyc ava",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
"test": "xo && nyc ava"
},

@@ -40,3 +39,3 @@ "files": [

"@szmarczak/http-timer": "^1.1.0",
"cacheable-request": "^4.0.1",
"cacheable-request": "^5.0.0",
"decompress-response": "^3.3.0",

@@ -51,8 +50,8 @@ "duplexer3": "^0.1.4",

"devDependencies": {
"ava": "1.0.0-beta.7",
"ava": "1.0.0-beta.8",
"coveralls": "^3.0.0",
"delay": "^3.0.0",
"delay": "^4.0.0",
"form-data": "^2.1.1",
"get-port": "^4.0.0",
"nyc": "^12.0.2",
"nyc": "^13.0.1",
"p-event": "^2.1.0",

@@ -66,3 +65,3 @@ "pem": "^1.4.4",

"tough-cookie": "^2.4.3",
"xo": "^0.22.0"
"xo": "^0.23.0"
},

@@ -69,0 +68,0 @@ "ava": {

@@ -22,3 +22,5 @@ <div align="center">

Got is for Node.js. For browsers, we recommend [Ky](https://github.com/sindresorhus/ky).
## Highlights

@@ -25,0 +27,0 @@

@@ -10,3 +10,3 @@ 'use strict';

const next = options => options.stream ? asStream(options) : asPromise(options);
const getPromiseOrStream = options => options.stream ? asStream(options) : asPromise(options);
const mergeOptions = (defaults, options = {}) => merge({}, defaults, options);

@@ -27,3 +27,5 @@

if (!defaults.handler) {
defaults.handler = next;
// This can't be getPromiseOrStream, because when merging
// the chain would stop at this point and no further handlers would be called.
defaults.handler = (options, next) => next(options);
}

@@ -33,3 +35,3 @@

try {
return defaults.handler(normalizeArguments(url, options, defaults), next);
return defaults.handler(normalizeArguments(url, options, defaults), getPromiseOrStream);
} catch (error) {

@@ -52,5 +54,3 @@ if (options && options.stream) {

got.stream = (url, options) => {
return defaults.handler(normalizeArguments(url, {...options, stream: true}, defaults), next);
};
got.stream = (url, options) => got(url, {...options, stream: true});

@@ -57,0 +57,0 @@ for (const method of aliases) {

@@ -197,4 +197,4 @@ 'use strict';

backoff = options.gotRetry.retries(++retryTries, error);
} catch (error) {
emitter.emit('error', error);
} catch (error2) {
emitter.emit('error', error2);
return;

@@ -205,3 +205,3 @@ }

retryCount++;
setTimeout(get, backoff, options);
setTimeout(get, backoff, {...options, forceRefresh: true});
cb(true);

@@ -208,0 +208,0 @@ return;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc