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

outport

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

outport - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

11

dist/public/services/httpClient.js

@@ -33,3 +33,12 @@ "use strict";

const buildFetchOptions = (method, headers, body) => {
const options = { method: method.toUpperCase(), headers };
const modifiedHeaders = { ...headers };
// Set Content-Type header if body is a string
if (body && typeof body === 'string') {
modifiedHeaders['Content-Type'] = 'application/json';
}
const options = {
method: method.toUpperCase(),
headers: modifiedHeaders,
};
// Add the body only if it's a POST or PUT request
if (body && ['POST', 'PUT'].includes(method.toUpperCase())) {

@@ -36,0 +45,0 @@ options.body = body;

2

package.json
{
"name": "outport",
"version": "1.0.5",
"version": "1.0.6",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "types": "dist/index.d.ts",

@@ -34,3 +34,3 @@ const testApi = async (data: {

const errorResp: { success: boolean, time: string, errorMessage?: string } = { success: false, time: convertMillSecToReadable(Date.now() - startTime) }
if(typeof error == 'string'){
if (typeof error == 'string') {
errorResp.errorMessage = error

@@ -51,6 +51,19 @@ }

): RequestInit => {
const options: RequestInit = { method: method.toUpperCase(), headers };
const modifiedHeaders = { ...headers };
// Set Content-Type header if body is a string
if (body && typeof body === 'string') {
modifiedHeaders['Content-Type'] = 'application/json';
}
const options: RequestInit = {
method: method.toUpperCase(),
headers: modifiedHeaders,
};
// Add the body only if it's a POST or PUT request
if (body && ['POST', 'PUT'].includes(method.toUpperCase())) {
options.body = body;
}
return options;

@@ -70,11 +83,11 @@ };

if (minutes) {
if(time) time+=", "
if (time) time += ", "
time += `${minutes}m`
}
if (seconds) {
if(time) time+=", "
if (time) time += ", "
time += `${seconds}s`
}
if (milliseconds) {
if(time) time+=", "
if (time) time += ", "
time += `${milliseconds}ms`

@@ -81,0 +94,0 @@ }

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