[`ty`] Reject renaming files to start with slash in Playground (#20666)

This commit is contained in:
Takayuki Maeda 2025-10-01 22:54:28 +09:00 committed by GitHub
parent 56d630e303
commit eb34d12151
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -96,6 +96,11 @@ export default function Playground() {
file: FileId,
newName: string,
) => {
if (newName.startsWith("/")) {
setError("File names cannot start with '/'.");
return;
}
const handle = files.handles[file];
let newHandle: FileHandle | null = null;
if (handle == null) {