blob: d5679dc98afa98df49d8137a6f3c6b91995aa0d2 [file] [log] [blame]
import * as vscode from "vscode";
export function getNonce() {
let text = "";
const possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (let i = 0; i < 32; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
}
export function getUri(webview: vscode.Webview, extensionUri: vscode.Uri, pathList: string[]) {
return webview.asWebviewUri(vscode.Uri.joinPath(extensionUri, ...pathList));
}