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

helpful-functions

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

helpful-functions - npm Package Compare versions

Comparing version 1.0.8 to 1.0.9

4

dist/index.d.ts

@@ -24,3 +24,3 @@ /**

*/
export declare const get: (src: string, config?: object) => Promise<JSON>;
export declare const get: (src: string, config?: object | undefined) => Promise<JSON>;
/**

@@ -35,3 +35,3 @@ * Creates Post request and returns the response

*/
export declare const post: (src: string, payload: object, config?: object) => Promise<JSON>;
export declare const post: (src: string, payload: object, config?: object | undefined) => Promise<JSON>;
/**

@@ -38,0 +38,0 @@ * This prints the string with the colors in the console

@@ -8,2 +8,3 @@ "use strict";

const lodash_clonedeep_1 = __importDefault(require("lodash.clonedeep"));
const node_fetch_1 = __importDefault(require("node-fetch"));
/**

@@ -34,4 +35,4 @@ * Function that returns if the array is empty or not

*/
const get = async (src, config = {}) => {
const response = await fetch(src, config);
const get = async (src, config) => {
const response = await node_fetch_1.default(src, config);
const json = await response.json();

@@ -50,6 +51,10 @@ return json;

*/
const post = async (src, payload, config = {}) => {
const response = await fetch(src, {
const post = async (src, payload, config) => {
const response = await node_fetch_1.default(src, {
...config,
method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify(payload),

@@ -88,5 +93,5 @@ });

];
// const main = () => {
// const main = async () => {
// };
// main();
//# sourceMappingURL=index.js.map
{
"name": "helpful-functions",
"version": "1.0.8",
"version": "1.0.9",
"description": "",

@@ -25,2 +25,3 @@ "main": "dist/",

"@types/lodash.clonedeep": "^4.5.6",
"@types/node-fetch": "^2.5.10",
"ts-node": "^10.0.0",

@@ -30,4 +31,5 @@ "typescript": "^4.3.4"

"dependencies": {
"lodash.clonedeep": "^4.5.0"
"lodash.clonedeep": "^4.5.0",
"node-fetch": "^2.6.1"
}
}
import cloneDeep from "lodash.clonedeep";
import fetch from "node-fetch";

@@ -28,3 +29,3 @@ /**

*/
export const get = async (src: string, config: object = {}): Promise<JSON> => {
export const get = async (src: string, config?: object): Promise<JSON> => {
const response = await fetch(src, config);

@@ -47,3 +48,3 @@ const json = await response.json();

payload: object,
config: object = {}
config?: object
): Promise<JSON> => {

@@ -53,2 +54,6 @@ const response = await fetch(src, {

method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
body: JSON.stringify(payload),

@@ -88,4 +93,4 @@ });

// const main = () => {
// const main = async () => {
// };
// main();

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