import { match } from 'path-to-regexp'; const path = '/actor/revs/:actorId/:slug?'; const urlMatch = match(path, { decode: decodeURIComponent }); export default (pageContext) => { const matched = urlMatch(pageContext.urlPathname); if (matched) { return { routeParams: { actorId: matched.params.actorId, domain: 'actors', }, }; } return false; };