mirror of
https://github.com/ferdikoomen/openapi-typescript-codegen.git
synced 2025-12-08 20:16:21 +00:00
14 lines
465 B
TypeScript
14 lines
465 B
TypeScript
import { readSpecFromDisk } from './readSpecFromDisk';
|
|
import { readSpecFromHttp } from './readSpecFromHttp';
|
|
import { readSpecFromHttps } from './readSpecFromHttps';
|
|
|
|
export const readSpec = async (input: string): Promise<string> => {
|
|
if (input.startsWith('https://')) {
|
|
return await readSpecFromHttps(input);
|
|
}
|
|
if (input.startsWith('http://')) {
|
|
return await readSpecFromHttp(input);
|
|
}
|
|
return await readSpecFromDisk(input);
|
|
};
|