Files
rea/src/reference/ReferenceSourceReaderPaths.ts
T

11 lines
317 B
TypeScript

import { relative, sep } from "node:path";
import { isPathWithinRoot } from "../domain/localPath.js";
export const pathFromRoot = (root: string, path: string): string => {
const value = relative(root, path);
return isPathWithinRoot(root, path)
? value.split(sep).join("/") || "."
: "<outside-root>";
};