added doga

This commit is contained in:
szabomarton
2025-02-25 09:55:29 +01:00
parent 5174ab4cc4
commit 13254e5623
1149 changed files with 80161 additions and 0 deletions

24
25_02_24/node_modules/@tinyhttp/url/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import { parse } from "node: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 getPathname = (url) => url.slice(0, getQueryIndex(url));
const getQueryParams = (url = "/") => parse(url.slice(getQueryIndex(url) + 1));
export {
getPathname,
getQueryParams,
getURLParams
};
//# sourceMappingURL=index.js.map