import { NextRequest } from 'next/server';

export const getParams = (request: NextRequest) =>
  Array.from(request.nextUrl.searchParams.entries()).reduce(
    (pr, cr) => {
      pr[cr[0]] = cr[1];

      return pr;
    },
    {} as Record<string, string>,
  );
