Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function parseServices(proto: Proto) {
const services: {[key: string]: ProtoService} = {};
walkServices(proto, (service: Service, _: any, serviceName: string) => {
const mocks = mockRequestMethods(service);
services[serviceName] = {
serviceName: serviceName,
proto,
methodsMocks: mocks,
methodsName: Object.keys(mocks),
};
});
return services;
}
const protos = await Promise.all(filePaths.map((fileName) =>
fromFileName(fileName, [
...(importPaths ? importPaths : []),
...commonProtosPath,
])
));
walkServices(proto, (service: Service, _: any, serviceName: string) => {
const mocks = mockRequestMethods(service);
services[serviceName] = {
serviceName: serviceName,
proto,
methodsMocks: mocks,
methodsName: Object.keys(mocks),
};
});