openapi-typescript-codegen/src/utils/postProcessService.ts
2020-09-27 14:25:19 +02:00

14 lines
548 B
TypeScript

import type { Service } from '../client/interfaces/Service';
import { postProcessServiceImports } from './postProcessServiceImports';
import { postProcessServiceOperations } from './postProcessServiceOperations';
export function postProcessService(service: Service): Service {
const clone = { ...service };
clone.operations = postProcessServiceOperations(clone);
clone.operations.forEach(operation => {
clone.imports.push(...operation.imports);
});
clone.imports = postProcessServiceImports(clone);
return clone;
}