import * as R from 'ramda'; import { match } from 'path-to-regexp'; export const matchParams = (url: string, path: string): Record => { const matchFn = match(path); const matchRes = matchFn(url); let res = {}; if (matchRes && !R.isEmpty(matchRes)) { res = matchRes.params; } return res; };