core/predicates/route.predicate.ts

core/predicates/route.predicate.ts is a file in Bane's Lab Build Scripts. 9 lines of code and 3 definitions.

import { FILE_ANCHOR } from "@banes-lab/web/ids/anatomy.ids";
import { FILE_ROUTES } from "#configuration/constants/site.constants";

const SLASH = "/";

export const isFileRoute = function isFileRoute(address: string): boolean {
    return FILE_ROUTES.some((route) => address.startsWith(route));
};

export const isSourceFilePage = function isSourceFilePage(path: string): boolean {
    return path.slice(path.lastIndexOf(SLASH) + 1).startsWith(FILE_ANCHOR);
};