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

@altangent/lib-http

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@altangent/lib-http - npm Package Compare versions

Comparing version 0.12.8 to 0.12.9

3

dist/Request.d.ts

@@ -7,2 +7,3 @@ export declare type requestOptions = {

rejectUnauthorized?: boolean;
returnRaw?: boolean;
};

@@ -13,2 +14,2 @@ /**

*/
export declare function request({ url, method, headers, json, rejectUnauthorized, }: requestOptions): Promise<any>;
export declare function request({ url, method, headers, json, rejectUnauthorized, returnRaw, }: requestOptions): Promise<any>;

@@ -15,3 +15,3 @@ "use strict";

*/
function request({ url, method = "GET", headers = {}, json, rejectUnauthorized, }) {
function request({ url, method = "GET", headers = {}, json, rejectUnauthorized, returnRaw = false, }) {
return new Promise((resolve, reject) => {

@@ -34,3 +34,3 @@ const { protocol, hostname, port, path } = urlutil.parse(url);

const statusCode = res.statusCode;
const body = safeParse(rawBody);
const body = returnRaw ? rawBody : safeParse(rawBody);
if (statusCode === 200) {

@@ -37,0 +37,0 @@ resolve(body);

@@ -16,2 +16,3 @@ /* eslint-disable @typescript-eslint/no-unsafe-assignment */

rejectUnauthorized?: boolean;
returnRaw?: boolean;
};

@@ -29,2 +30,3 @@

rejectUnauthorized,
returnRaw = false,
}: requestOptions): Promise<any> {

@@ -52,3 +54,3 @@ return new Promise((resolve, reject) => {

const statusCode = res.statusCode;
const body = safeParse(rawBody);
const body = returnRaw ? rawBody : safeParse(rawBody);
if (statusCode === 200) {

@@ -55,0 +57,0 @@ resolve(body);

{
"name": "@altangent/lib-http",
"version": "0.12.8",
"version": "0.12.9",
"description": "Basic HTTP/S client utilities",

@@ -26,3 +26,3 @@ "author": "Brian Mancini <bmancini@gmail.com>",

"homepage": "https://github.com/altangent/libs/tree/main/packages/http",
"gitHead": "9148b93bd49ecf5d7e20e9cee500987353b9e7d7",
"gitHead": "4c7a6ea0f0d39032d0aee188d2c403a0f92ceaaf",
"publishConfig": {

@@ -29,0 +29,0 @@ "access": "public"

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