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

@digitalbazaar/http-client

Package Overview
Dependencies
Maintainers
5
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@digitalbazaar/http-client - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

lib/agentCompatibility-browser.js

21

lib/httpClient.js
/*!
* Copyright (c) 2020-2022 Digital Bazaar, Inc. All rights reserved.
*/
import {convertAgent} from './agentCompatibility.js';
export const kyOriginalPromise = import('ky-universal')

@@ -30,2 +32,5 @@ .then(({default: ky}) => ky);

} = {}) {
// convert legacy agent options
params = convertAgent(params);
// create new ky instance that will asynchronously resolve

@@ -42,3 +47,3 @@ const kyPromise = parent.then(kyBase => {

// extend parent
ky = kyBase.extend({headers, params});
ky = kyBase.extend({headers, ...params});
}

@@ -48,2 +53,6 @@ return ky;

return _createHttpClient(kyPromise);
}
function _createHttpClient(kyPromise) {
async function httpClient(...args) {

@@ -55,2 +64,5 @@ const ky = await kyPromise;

}
// convert legacy agent options
args[1] = convertAgent(args[1]);
return ky.apply(ky, args);

@@ -67,7 +79,7 @@ }

httpClient.create = function({headers = {}, ...params}) {
return createInstance({headers, params});
return createInstance({headers, ...params});
};
httpClient.extend = function({headers = {}, ...params}) {
return createInstance({parent: kyPromise, headers, params});
return createInstance({parent: kyPromise, headers, ...params});
};

@@ -87,2 +99,5 @@

async function _handleResponse(target, thisArg, args) {
// convert legacy agent options
args[1] = convertAgent(args[1]);
let response;

@@ -89,0 +104,0 @@ const [url] = args;

8

package.json
{
"name": "@digitalbazaar/http-client",
"version": "3.1.0",
"version": "3.2.0",
"description": "An opinionated, isomorphic HTTP client.",

@@ -12,2 +12,5 @@ "license": "BSD-3-Clause",

},
"browser": {
"./lib/agentCompatibility.js": "./lib/agentCompatibility-browser.js"
},
"scripts": {

@@ -35,3 +38,4 @@ "rollup": "rollup -c rollup.config.js",

"ky": "^0.30.0",
"ky-universal": "^0.10.1"
"ky-universal": "^0.10.1",
"undici": "^5.2.0"
},

@@ -38,0 +42,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

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