Socket
Socket
Sign inDemoInstall

@tinyhttp/url

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinyhttp/url - npm Package Compare versions

Comparing version 1.1.2 to 1.1.4

3

dist/index.d.ts

@@ -7,6 +7,7 @@ import { ParsedUrlQuery } from 'querystring';

export declare const getURLParams: ({ pattern, keys }: Regex, reqUrl?: string) => URLParams;
export declare const getQueryParams: (url?: string) => ParsedUrlQuery;
export declare type URLParams = {
[key: string]: string;
};
export declare const getPathname: (u: string) => string;
export declare const getQueryParams: (url?: string) => ParsedUrlQuery;
export {};

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

import { parse } from 'url';
import { parse } from 'querystring';

@@ -6,10 +6,13 @@ const getURLParams = ({ pattern, keys }, reqUrl = '/') => {

const params = {};
if (matches) {
if (matches)
for (let i = 0; i < keys.length; i++)
params[keys[i]] = matches[i + 1];
}
return params;
};
const getQueryParams = (url = '/') => parse(url, true).query;
const getPathname = (u) => {
const end = u.indexOf('?');
return u.slice(0, end === -1 ? u.length : end);
};
const getQueryParams = (url = '/') => parse(url.slice(url.indexOf('?') + 1));
export { getQueryParams, getURLParams };
export { getPathname, getQueryParams, getURLParams };
{
"name": "@tinyhttp/url",
"version": "1.1.2",
"version": "1.1.4",
"type": "module",

@@ -5,0 +5,0 @@ "description": "URL extensions for tinyhttp",

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