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

http-source

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-source - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

22

dist/index.js

@@ -153,2 +153,24 @@ "use strict";

};
this.httpPatch = function (urlPath, body, headers) {
if (headers === void 0) { headers = {}; }
return __awaiter(_this, void 0, void 0, function () {
var response, err_5, error;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
return [4, this.remote.patch(urlPath, body, { headers: _.merge({}, { 'Content-Type': this.defaultContentType }, this.globalHeaders, headers) })];
case 1:
response = _a.sent();
return [2, response.data];
case 2:
err_5 = _a.sent();
error = this.ErrorParser(err_5);
this.onHttpError.dispatch(error);
throw error;
case 3: return [2];
}
});
});
};
this.remote = axios_1.default.create({ baseURL: baseUrl });

@@ -155,0 +177,0 @@ if (options.request) {

5

index.d.ts

@@ -24,6 +24,6 @@

contentType?: string
},
}
error?: {
parse?: (error: AxiosError) => ErrorInstance
},
}
}

@@ -47,3 +47,4 @@

public httpDelete<ResponseBody>(urlPath: string, queryParams: HttpQueryParams, headers?: HttpHeaders): Promise<ResponseBody>
public httpPatch<ResponseBody>(urlPath: string, body: any, headers?: HttpHeaders): Promise<ResponseBody>
}
}

2

package.json
{
"name": "http-source",
"version": "1.0.0",
"version": "1.1.0",
"description": "",

@@ -5,0 +5,0 @@ "keywords": [

@@ -110,2 +110,13 @@

}
public httpPatch = async <ResponseBody>(urlPath: string, body: any, headers: HttpHeaders = {}): Promise<ResponseBody> => {
try {
const response = await this.remote.patch(urlPath, body, { headers: _.merge({}, { 'Content-Type': this.defaultContentType }, this.globalHeaders, headers) })
return response.data
} catch (err) {
const error = this.ErrorParser(err)
this.onHttpError.dispatch(error)
throw error
}
}
}

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