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

@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 2.0.6 to 2.0.7

vite.config.ts

36

dist/index.js

@@ -1,21 +0,23 @@

import { parse } from 'querystring';
const getURLParams = ({ pattern, keys }, reqUrl = '/') => {
const matches = pattern.exec(reqUrl);
const params = {};
if (matches && typeof keys !== 'boolean')
for (let i = 0; i < keys.length; i++) {
if (matches[i + 1]) {
params[keys[i]] = decodeURIComponent(matches[i + 1]);
}
}
return params;
import { parse } from "querystring";
const getURLParams = ({ pattern, keys }, reqUrl = "/") => {
const matches = pattern.exec(reqUrl);
const params = {};
if (matches && typeof keys !== "boolean")
for (let i = 0; i < keys.length; i++) {
if (matches[i + 1]) {
params[keys[i]] = decodeURIComponent(matches[i + 1]);
}
}
return params;
};
const getQueryIndex = (url) => {
const index = url.indexOf('?');
return index === -1 ? url.length : index;
const index = url.indexOf("?");
return index === -1 ? url.length : index;
};
const getPathname = (url) => url.slice(0, getQueryIndex(url));
const getQueryParams = (url = '/') => parse(url.slice(getQueryIndex(url) + 1));
export { getPathname, getQueryParams, getURLParams };
const getQueryParams = (url = "/") => parse(url.slice(getQueryIndex(url) + 1));
export {
getPathname,
getQueryParams,
getURLParams
};
{
"name": "@tinyhttp/url",
"version": "2.0.6",
"version": "2.0.7",
"type": "module",

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

"license": "MIT",
"dependencies": {},
"scripts": {
"build": "rollup -c ./rollup.config.js"
"dev": "vite",
"build": "vite build",
"postbuild": "tsc --emitDeclarationOnly"
}
}
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