INNER CODE UNIT · TypeScript
configureWorkerFactory
prisma/orm · apps/lsp-playground/src/client/main.ts:117
function configureWorkerFactory(logger?: ILogger): void {
const workerLoaders = {
editorWorkerService: () => new Worker(editorWorkerUrl, { type: 'module' }),
};
const config = logger !== undefined ? { workerLoaders, logger } : { workerLoaders };
useWorkerFactory(config);
}
function buildWebSocketUrl(wsPath: string): string {
const host = `${window.location.host}${wsPath}`;
// nosemgrep: javascript.lang.security.detect-insecure-websocket.detect-insecure-websocket
return window.location.protocol === 'https:' ? `wss://${host}` : `ws://${host}`;
}
function basename(path: string): string {
return path.slice(path.lastIndexOf('/') + 1);
}