Files
overlord/Overlord-Server/src/server/plugin-utils.ts
T
2026-03-05 00:04:26 -06:00

10 lines
238 B
TypeScript

import path from "path";
export function sanitizePluginId(name: string): string {
const cleaned = path.basename(name).replace(/[^A-Za-z0-9._-]/g, "");
if (!cleaned) {
throw new Error("Invalid plugin id");
}
return cleaned;
}