/**
 * Helper to get path parameter
 */
export const getParam = (req, key) => {
    const direct = req.getParam?.(key);
    if (typeof direct === 'string' && direct.length > 0)
        return direct;
    const params = req.params ?? {};
    return params[key] ?? '';
};
