Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function getHttpTransportTypes(): HttpTransportType[] {
const transportTypes = [];
if (typeof window === "undefined") {
transportTypes.push(HttpTransportType.WebSockets);
transportTypes.push(HttpTransportType.ServerSentEvents);
} else {
if (typeof WebSocket !== "undefined") {
transportTypes.push(HttpTransportType.WebSockets);
}
if (typeof EventSource !== "undefined") {
transportTypes.push(HttpTransportType.ServerSentEvents);
}
}
transportTypes.push(HttpTransportType.HttpStreaming);
transportTypes.push(HttpTransportType.LongPolling);
return transportTypes;
}
export function getHttpTransportTypes(): HttpTransportType[] {
const transportTypes = [];
if (typeof window === "undefined") {
transportTypes.push(HttpTransportType.WebSockets);
transportTypes.push(HttpTransportType.ServerSentEvents);
} else {
if (typeof WebSocket !== "undefined") {
transportTypes.push(HttpTransportType.WebSockets);
}
if (typeof EventSource !== "undefined") {
transportTypes.push(HttpTransportType.ServerSentEvents);
}
}
transportTypes.push(HttpTransportType.HttpStreaming);
transportTypes.push(HttpTransportType.LongPolling);
return transportTypes;
}