assemblyai
Version:
The AssemblyAI JavaScript SDK provides an easy-to-use interface for interacting with the AssemblyAI API, which supports async and real-time transcription, as well as the latest LeMUR models.
19 lines (16 loc) • 510 B
text/typescript
import { PolyfillWebSocketFactory, PolyfillWebSocket } from ".";
export { PolyfillWebSocket } from ".";
const PolyfillWebSocket =
WebSocket ?? global?.WebSocket ?? window?.WebSocket ?? self?.WebSocket;
export const factory: PolyfillWebSocketFactory = (
url: string,
params?: unknown,
) => {
if (params) {
return new PolyfillWebSocket(
url,
params as string | string[],
) as unknown as PolyfillWebSocket;
}
return new PolyfillWebSocket(url) as unknown as PolyfillWebSocket;
};