Sha256: 603dbe9c61e95085bb72d30f343dc660d59c2090a63cedf50270c7db4aa910e2
Contents?: true
Size: 708 Bytes
Versions: 26
Compression:
Stored size: 708 Bytes
Contents
import type { Path } from './matchRequestUrl' import { cleanUrl } from '../url/cleanUrl' import { getAbsoluteUrl } from '../url/getAbsoluteUrl' /** * Normalizes a given request handler path: * - Preserves RegExp. * - Removes query parameters and hashes. * - Rebases relative URLs against the "baseUrl" or the current location. * - Preserves relative URLs in Node.js, unless specified otherwise. * - Preserves optional path parameters. */ export function normalizePath(path: Path, baseUrl?: string): Path { // RegExp paths do not need normalization. if (path instanceof RegExp) { return path } const maybeAbsoluteUrl = getAbsoluteUrl(path, baseUrl) return cleanUrl(maybeAbsoluteUrl) }
Version data entries
26 entries across 26 versions & 1 rubygems