function matcher(path) {
    const params = [];
    const rx = pathRegexp(path, params);
    return function (pathname) {
        const match = rx.exec(pathname);