mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
21 lines
647 B
TypeScript
21 lines
647 B
TypeScript
import { HttpClient } from '../HttpClient';
|
|
|
|
/**
|
|
* Generate the HttpRequest filename based on the selected client
|
|
* @param httpClient The selected httpClient (fetch, xhr, node or axios)
|
|
*/
|
|
export const getHttpRequestName = (httpClient: HttpClient): string => {
|
|
switch (httpClient) {
|
|
case HttpClient.FETCH:
|
|
return 'FetchHttpRequest';
|
|
case HttpClient.XHR:
|
|
return 'XHRHttpRequest';
|
|
case HttpClient.NODE:
|
|
return 'NodeHttpRequest';
|
|
case HttpClient.AXIOS:
|
|
return 'AxiosHttpRequest';
|
|
case HttpClient.ANGULAR:
|
|
return 'AngularHttpRequest';
|
|
}
|
|
};
|