// Copyright (C) 2024 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only import { Uri, Webview } 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: Webview, extensionUri: Uri, pathList: string[] ) { return webview.asWebviewUri(Uri.joinPath(extensionUri, ...pathList)); }