import { tryDecodeURIComponent } from './string.js';
export function pathIncludesLink(location, link) {
    return link
        ? tryDecodeURIComponent(location.pathname + location.hash).includes(tryDecodeURIComponent(link.toLowerCase()))
        : false;
}
export function pathMatchedLink(location, link = '') {
    const lowercaseLink = tryDecodeURIComponent(link.toLowerCase());
    return (tryDecodeURIComponent(location.pathname) === lowercaseLink ||
        tryDecodeURIComponent(location.hash) === lowercaseLink ||
        tryDecodeURIComponent(location.pathname + location.hash) === lowercaseLink);
}
export function normalizePath(path) {
    if (!path.startsWith('/')) {
        path = '/' + path;
    }
    if (path.endsWith('/')) {
        path = path.slice(0, -1);
    }
    return path;
}
//# sourceMappingURL=path.js.map