MCPcopy Create free account
hub / github.com/Botloader/botloader / checkValidName

Function checkValidName

botloader-vscode/src/guildspace.ts:470–479  ·  view source on GitHub ↗
(wsFolder: vscode.Uri, name: string)

Source from the content-addressed store, hash-verified

468// while this isn't needed as the backend does verification, this is a last resort to make sure
469// script names and use ../ to escape the workspace folder
470function checkValidName(wsFolder: vscode.Uri, name: string) {
471 const uri = vscode.Uri.joinPath(wsFolder, `/${name}.ts`);
472 const resolved = vscode.workspace.getWorkspaceFolder(uri);
473 if (resolved && resolved.uri.toString() === wsFolder.toString()) {
474 // this is inside the workspace folder
475 return true;
476 }
477
478 return false;
479}
480
481export interface BotloaderSourceControl extends vscode.SourceControl {
482 isBotloaderSourceControl: true,

Callers 1

syncWorkspaceMethod · 0.85

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected