export interface UrlParamTransform { fromParam: (x: string) => T; toParam: (x: T) => string; } const identity: (x: T) => T = (x) => x; export const stringParamTransform: UrlParamTransform = { fromParam: identity, toParam: identity }; export const intParamTransform: UrlParamTransform = { fromParam: x => parseInt(x, 10), toParam: x => x.toString() };