UNPKG

burger-api

Version:

<div align="center"> <a href="https://burger-api.com"> <img src="https://github.com/user-attachments/assets/0d9b376e-1d89-479a-aa7f-e7ee3c6b2342" alt="BurgerAPI"/> </a> </div>

15 lines (14 loc) 835 B
import type { BurgerRequest } from '../types/index'; /** * Extracts the pathname from a full URL string, removing query parameters. * @param url - The full URL string (e.g., "http://localhost:4000/api/users/123/profile?id=1") * @returns The extracted pathname (e.g., "/api/users/123/profile") */ export declare function extractPathnameFromUrl(url: string): string; /** * Extracts wildcard parameters from a request pathname and sets them on the request object. * @param request - The request object to modify * @param pathname - The pathname extracted from the URL (e.g., "/api/users/123/profile") * @param baseSegmentCount - Number of segments before the wildcard (e.g., 3 for "/api/users/:userId/*") */ export declare function extractWildcardParams(request: BurgerRequest, pathname: string, baseSegmentCount: number): void;