// src/utils/rateLimit.ts
import { Request } from 'express';

const isTestEnv = process.env.NODE_ENV === 'test';

/**
 * Helper to determine if rate limiting should be skipped.
 * Skips in test environment unless explicitly enabled via header.
 */
export const shouldSkipRateLimit = (req: Request) => {
  if (!isTestEnv) return false;
  return req.headers['x-test-rate-limit-enable'] !== 'true';
};