export function matchPath(pathname, pattern) {
    const match = pattern.exec(pathname);
    if (!match)
        return undefined;
    return match.slice(1).map((value) => decodeURIComponent(value));
}
export function firstCapture(captures) {
    const first = captures[0];
    if (!first)
        throw new Error("Route match did not include required path capture.");
    return first;
}
export function secondCapture(captures) {
    const second = captures[1];
    if (!second)
        throw new Error("Route match did not include required second path capture.");
    return second;
}
