Merge pull request #1560 from grpc/revert-1556-master

Revert "fix(grpc-js): Add support for impl type to server.addService"
This commit is contained in:
Michael Lumish 2020-09-02 16:04:42 -07:00 committed by GitHub
commit f2d3b4d1ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View File

@ -144,13 +144,9 @@ export class Server {
throw new Error('Not implemented. Use addService() instead');
}
addService<
ImplementationType extends {
[key: string]: any
}
>(
service: ServiceDefinition<ImplementationType>,
implementation: ImplementationType
addService(
service: ServiceDefinition,
implementation: UntypedServiceImplementation
): void {
if (this.started === true) {
throw new Error("Can't add a service to a started server.");

View File

@ -181,7 +181,7 @@ describe('Server', () => {
const server = new Server();
assert.throws(() => {
server.addService(({} as any), dummyImpls);
server.addService({}, dummyImpls);
}, /Cannot add an empty service to a server/);
});