import mapValues from "lodash/mapValues" ; import { match as Match } from "react-router" ; export default function decodedParams < Params extends { [ K in keyof Params ] ? : string ; } > ( match ) { return mapValues ( match . params , ( param ) => param ? decodeURIComponent ( param ) : param ) as Params ; }