import { Request } from 'express';

/**
 * Extract a route parameter as a string.
 * Express 5 types params as string | string[]; this helper narrows it.
 */
export function param(req: Request, name: string): string {
  const val = req.params[name];
  if (Array.isArray(val)) return val[0];
  return val;
}
