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

getfy

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

getfy - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

.yarnrc.yml

26

build/index.js

@@ -37,4 +37,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

};
import axios from "axios";
var getify = function (url) { return __awaiter(void 0, void 0, void 0, function () {
var urlAndParamsRaw, urlBase, paramsRaw, params, i, keyValue;
var urlAndParamsRaw, urlBase, paramsRaw, urlVars, i, keyValue, reqUrl, paramsKeys, paramsValues, i;
return __generator(this, function (_a) {

@@ -44,8 +45,25 @@ urlAndParamsRaw = url.split("?");

paramsRaw = urlAndParamsRaw[1].split("&");
params = {};
urlVars = {};
for (i = 0; i < paramsRaw.length; i++) {
keyValue = paramsRaw[i].split("=");
params[keyValue[0]] = keyValue[1];
if (keyValue[0] == "params") {
urlVars[keyValue[0]] = JSON.parse(keyValue[1]);
}
else {
urlVars[keyValue[0]] = keyValue[1];
}
}
console.log(urlBase, params);
reqUrl = "".concat(urlBase, "?");
paramsKeys = Object.keys(urlVars["params"]);
paramsValues = Object.values(urlVars["params"]);
console.log(paramsKeys);
for (i = 0; i < paramsKeys.length; i++) {
if (i == paramsKeys.length - 1) {
reqUrl += "".concat(paramsKeys[i], "=").concat(paramsValues[i]);
}
else {
reqUrl += "".concat(paramsKeys[i], "=").concat(paramsValues[i], "&");
}
}
axios.get(reqUrl);
return [2 /*return*/, "getify"];

@@ -52,0 +70,0 @@ });

6

package.json
{
"name": "getfy",
"version": "0.0.2",
"license":"MIT",
"version": "0.0.3",
"license": "MIT",
"packageManager": "yarn@4.3.1",

@@ -11,3 +11,3 @@ "main": "build/index.js",

},
"scripts":{
"scripts": {
"build": "tsc",

@@ -14,0 +14,0 @@ "dev": "build && node test.js"

@@ -0,1 +1,3 @@

import axios from "axios"
const getify = async (url:string)=>{

@@ -5,8 +7,23 @@ const urlAndParamsRaw = url.split("?")

const paramsRaw = urlAndParamsRaw[1].split("&")
const params = {}
let urlVars = {}
for(let i =0;i < paramsRaw.length; i++){
const keyValue = paramsRaw[i].split("=")
params[keyValue[0]] = keyValue[1]
if(keyValue[0] == "params"){
urlVars[keyValue[0]] = JSON.parse(keyValue[1])
}else{
urlVars[keyValue[0]] = keyValue[1]
}
}
console.log(urlBase,params)
let reqUrl = `${urlBase}?`;
const paramsKeys = Object.keys(urlVars["params"])
const paramsValues = Object.values(urlVars["params"])
console.log(paramsKeys)
for(let i=0;i<paramsKeys.length;i++){
if(i == paramsKeys.length -1){
reqUrl += `${paramsKeys[i]}=${paramsValues[i]}`
}else{
reqUrl += `${paramsKeys[i]}=${paramsValues[i]}&`
}
}
axios.get(reqUrl)
return "getify"

@@ -13,0 +30,0 @@ }

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