import path from "node:path"; import { shortenHomeInString } from "../utils.js"; import type { PluginRecord } from "./registry.js"; import type { PluginSourceRoots } from "./roots.js";
export { resolvePluginSourceRoots } from "./roots.js";
export type { PluginSourceRoots } from "./roots.js";
function tryRelative(root: string, filePath: string): string | null { const rel = path.relative(root, filePath); if (!rel || rel === ".") { returnnull;
} if (rel === "..") { returnnull;
} if (rel.startsWith(`..${path.sep}`) || rel.startsWith("../") || rel.startsWith("..\\")) { returnnull;
} if (path.isAbsolute(rel)) { returnnull;
} // Normalize to forward slashes for display (path.relative uses backslashes on Windows) return rel.replaceAll("\\", "/");
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.