New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bridgets

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bridgets - npm Package Compare versions

Comparing version 1.0.46 to 1.0.47

2

dist/Lib/Compiler/fetchFile.d.ts

@@ -1,2 +0,2 @@

export declare const fetchFile = "import axios, { AxiosRequestConfig } from 'axios';\nimport FormData from 'form-data';\n\nconst urlServer = '';\n\ninterface FETCH {\n method: 'GET' | 'POST' | 'PATCH' | 'DELETE' | 'PUT';\n path: string;\n body?: Record<any, any>;\n query?: Record<string, string>;\n headers?: Record<string, string>;\n files?: Record<string, File>;\n}\n\nconst getQueryUrl = (query: FETCH[\"query\"]) => {\n let queryString = \"\"\n if (!query) return queryString\n\n Object.entries(query).forEach(([name, value]) => {\n queryString += `${name}=${value}&`\n })\n\n queryString.slice(0, -1)\n\n return queryString\n}\n\nexport const Fetch = async ({ path, method, body, query, headers, files }: FETCH) => {\n let completeUrl = urlServer.replace(/\\/$/, '') + path;\n if (query && Object.keys(query).length > 0) completeUrl += '?' + getQueryUrl(query)\n\n const config: AxiosRequestConfig = { url: completeUrl, method };\n\n if (headers) config.headers = headers;\n if (body) config.data = body;\n else if (files) {\n const formData = new FormData();\n Object.entries(files).forEach(([name, file]) => formData.append(name, file));\n config.data = formData;\n config.headers = { ...config.headers, 'Content-Type': 'multipart/form-data' };\n }\n\n return axios(config)\n .then((res) => res.data)\n .catch((err) => err.response.data);\n};";
export declare const fetchFile = "import axios, { AxiosRequestConfig } from 'axios';\nimport FormData from 'form-data';\n\nconst urlServer = '';\n\ninterface FETCH {\n method: 'GET' | 'POST' | 'PATCH' | 'DELETE' | 'PUT';\n path: string;\n body?: Record<any, any>;\n query?: Record<string, string>;\n headers?: Record<string, string>;\n files?: Record<string, File>;\n}\n\nconst getQueryUrl = (query: FETCH[\"query\"]): string => {\n if (!query || !Object.values(query).some((val) => val)) return \"\";\n\n return Object.entries(query)\n .filter(([_, value]) => value)\n .map(([key, value]) => `${key}=${value}`)\n .join(\"&\");\n};\n\nexport const Fetch = async ({ path, method, body, query, headers, files }: FETCH) => {\n let completeUrl = urlServer.replace(/\\/$/, '') + path;\n if (query && Object.keys(query).length > 0) completeUrl += '?' + getQueryUrl(query)\n\n const config: AxiosRequestConfig = { url: completeUrl, method };\n\n if (headers) config.headers = headers;\n if (body) config.data = body;\n else if (files) {\n const formData = new FormData();\n Object.entries(files).forEach(([name, file]) => formData.append(name, file));\n config.data = formData;\n config.headers = { ...config.headers, 'Content-Type': 'multipart/form-data' };\n }\n\n return axios(config)\n .then((res) => res.data)\n .catch((err) => err.response.data);\n};";
//# sourceMappingURL=fetchFile.d.ts.map

@@ -18,15 +18,11 @@ "use strict";

const getQueryUrl = (query: FETCH["query"]) => {
let queryString = ""
if (!query) return queryString
const getQueryUrl = (query: FETCH["query"]): string => {
if (!query || !Object.values(query).some((val) => val)) return "";
Object.entries(query).forEach(([name, value]) => {
queryString += \`\${name}=\${value}&\`
})
return Object.entries(query)
.filter(([_, value]) => value)
.map(([key, value]) => \`\${key}=\${value}\`)
.join("&");
};
queryString.slice(0, -1)
return queryString
}
export const Fetch = async ({ path, method, body, query, headers, files }: FETCH) => {

@@ -33,0 +29,0 @@ let completeUrl = urlServer.replace(/\\/$/, '') + path;

{
"name": "bridgets",
"version": "1.0.46",
"version": "1.0.47",
"description": "",

@@ -40,2 +40,3 @@ "main": "dist/Lib/index.js",

"adm-zip": "^0.5.9",
"form-data": "^4.0.0",
"formidable": "^2.0.1",

@@ -42,0 +43,0 @@ "json-schema-to-zod": "^0.1.1",

Sorry, the diff of this file is not supported yet

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