inital commit
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user