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.6 to 1.0.7

2

package.json
{
"name": "helpful-functions",
"version": "1.0.6",
"version": "1.0.7",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/",

@@ -31,3 +31,50 @@ import cloneDeep from "lodash.clonedeep";

};
/**
* Getter function to fetch json data from given path
*
* @param src the filepath or url path to the json data
* @returns json response
*
*/
export const get = async (src: string, config: object = {}): Promise<JSON> => {
const response = await fetch(src, config);
const json = await response.json();
return json;
};
/**
*
* @param src the url path or file path
* @param payload the body request data wanting to be sent
* @param config any other settings that can be added to the fetch js api
* @returns json response
*/
export const post = async (
src: string,
payload: object,
config: object = {}
): Promise<JSON> => {
const response = await fetch(src, {
...config,
method: "POST",
body: JSON.stringify(payload),
});
const json = await response.json();
return json;
};
/**
* This prints the string with the colors in the console
*
* @param array of colors
*
*/
export const logColors = (arrayOfColors: string[]): void => {
arrayOfColors.forEach((color) => {
console.log(`%c ${color}`, `color: ${color}`);
});
};
/**
* 10 good colors that work together

@@ -48,16 +95,4 @@ */

/**
* This prints the string with the colors in the console
*
* @param array of colors
*
*/
export const logColors = (arrayOfColors: string[]): void => {
arrayOfColors.forEach((color) => {
console.log(`%c ${color}`, `color: ${color}`);
});
};
// const main = () => {
// };
// main();
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