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 getHttpClients(): HttpClient[] {
const httpClients: HttpClient[] = [];
if (typeof XMLHttpRequest !== "undefined") {
httpClients.push(new XhrHttpClient(TestLogger.instance));
}
if (typeof fetch !== "undefined") {
httpClients.push(new FetchHttpClient(TestLogger.instance));
}
if (Platform.isNode) {
httpClients.push(new NodeHttpClient(TestLogger.instance));
}
return httpClients;
}