Skip to content

Commit

Permalink
doc: added JSDoc for sanitizeParams function
Browse files Browse the repository at this point in the history
  • Loading branch information
Elias-Chairi committed May 14, 2024
1 parent 50e1c8b commit 059b9f6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/astro/src/core/routing/manifest/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ import type { AstroConfig, RoutePart } from '../../../@types/astro.js';

import { compile } from 'path-to-regexp';

/**
* Sanitizes the parameters object by normalizing string values and replacing certain characters with their URL-encoded equivalents.
* @param {Record<string, string | number | undefined>} params - The parameters object to be sanitized.
* @returns {Record<string, string | number | undefined>} The sanitized parameters object.
*/
function sanitizeParams(params: Record<string, string | number | undefined>): Record<string, string | number | undefined> {
return Object.fromEntries(
Object.entries(params).map(([key, value]) => {
Expand Down

0 comments on commit 059b9f6

Please sign in to comment.