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

http-types

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

http-types - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

30

dist/index.js

@@ -151,19 +151,21 @@ "use strict";

}
const parseQuery = (searchParams) => {
const queryMap = new Object();
for (const [key, value] of searchParams) {
const parameterName = decodeURIComponent(key);
const parameterValue = decodeURIComponent(value);
let existingEntry = queryMap[parameterName];
if (!existingEntry) {
existingEntry = new Array();
queryMap[parameterName] = existingEntry;
}
existingEntry.push(parameterValue);
}
const query = new HttpQueryParameters(queryMap);
return query;
};
class HttpRequestBuilder {
static fromPath(requestData) {
const url = new URL("file://" + requestData.path);
const queryMap = new Object();
const queryString = url.search.substring(1);
for (const entry of queryString.split("&")) {
const pair = entry.split("=");
const parameterName = decodeURIComponent(pair[0]);
const parameterValue = decodeURIComponent(pair[1]);
let existingEntry = queryMap[parameterName];
if (!existingEntry) {
existingEntry = new Array();
queryMap[parameterName] = existingEntry;
}
existingEntry.push(parameterValue);
}
const query = new HttpQueryParameters(queryMap);
const query = parseQuery(url.searchParams);
const request = {

@@ -170,0 +172,0 @@ timestamp: requestData.timestamp ? requestData.timestamp : undefined,

{
"name": "http-types",
"version": "0.6.0",
"version": "0.6.1",
"description": "Library for JSON serialisation of HTTP exchanges",

@@ -5,0 +5,0 @@ "license": "MIT",

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

# ts-http-types
# HTTP Types in TypeScript
[![Build Status](https://github.com/Meeshkan/ts-http-types/workflows/Node.js%20CI/badge.svg)](https://github.com/Meeshkan/ts-http-types/actions?query=workflow%3A%22Node.js+CI%22)

@@ -3,0 +3,0 @@ [![MIT licensed](http://img.shields.io/:license-MIT-blue.svg)](LICENSE)

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