mirror of https://github.com/grpc/grpc-node.git
Merge pull request #620 from JustinBeckwith/noobj
refactor: drop usage of _.isObject
This commit is contained in:
commit
b472dc30cc
|
|
@ -861,6 +861,10 @@ var defaultHandler = {
|
|||
}
|
||||
};
|
||||
|
||||
function isObject(thing) {
|
||||
return (typeof thing === 'object' || typeof thing === 'function') && thing !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a service to the server, with a corresponding implementation.
|
||||
* @param {grpc~ServiceDefinition} service The service descriptor
|
||||
|
|
@ -868,7 +872,7 @@ var defaultHandler = {
|
|||
* names to method implementation for the provided service.
|
||||
*/
|
||||
Server.prototype.addService = function(service, implementation) {
|
||||
if (!_.isObject(service) || !_.isObject(implementation)) {
|
||||
if (!isObject(service) || !isObject(implementation)) {
|
||||
throw new Error('addService requires two objects as arguments');
|
||||
}
|
||||
if (Object.keys(service).length === 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue