mirror of https://github.com/grpc/grpc-node.git
				
				
				
			Merge pull request #622 from JustinBeckwith/isfun
refactor: drop usage of _.isFunction
This commit is contained in:
		
						commit
						d4f97546a2
					
				|  | @ -449,7 +449,7 @@ Client.prototype.resolveCallInterceptors = function(method_definition, intercept | |||
| Client.prototype.makeUnaryRequest = function(path, serialize, deserialize, | ||||
|                                              argument, metadata, options, | ||||
|                                              callback) { | ||||
|   if (_.isFunction(options)) { | ||||
|   if (typeof options === 'function') { | ||||
|     callback = options; | ||||
|     if (metadata instanceof Metadata) { | ||||
|       options = {}; | ||||
|  | @ -457,7 +457,7 @@ Client.prototype.makeUnaryRequest = function(path, serialize, deserialize, | |||
|       options = metadata; | ||||
|       metadata = new Metadata(); | ||||
|     } | ||||
|   } else if (_.isFunction(metadata)) { | ||||
|   } else if (typeof metadata === 'function') { | ||||
|     callback = metadata; | ||||
|     metadata = new Metadata(); | ||||
|     options = {}; | ||||
|  | @ -470,7 +470,7 @@ Client.prototype.makeUnaryRequest = function(path, serialize, deserialize, | |||
|   } | ||||
|   if (!((metadata instanceof Metadata) && | ||||
|         (options instanceof Object) && | ||||
|         (_.isFunction(callback)))) { | ||||
|         (typeof callback === 'function'))) { | ||||
|     throw new Error('Argument mismatch in makeUnaryRequest'); | ||||
|   } | ||||
| 
 | ||||
|  | @ -552,7 +552,7 @@ Client.prototype.makeUnaryRequest = function(path, serialize, deserialize, | |||
| Client.prototype.makeClientStreamRequest = function(path, serialize, | ||||
|                                                     deserialize, metadata, | ||||
|                                                     options, callback) { | ||||
|   if (_.isFunction(options)) { | ||||
|   if (typeof options === 'function') { | ||||
|     callback = options; | ||||
|     if (metadata instanceof Metadata) { | ||||
|       options = {}; | ||||
|  | @ -560,7 +560,7 @@ Client.prototype.makeClientStreamRequest = function(path, serialize, | |||
|       options = metadata; | ||||
|       metadata = new Metadata(); | ||||
|     } | ||||
|   } else if (_.isFunction(metadata)) { | ||||
|   } else if (typeof metadata === 'function') { | ||||
|     callback = metadata; | ||||
|     metadata = new Metadata(); | ||||
|     options = {}; | ||||
|  | @ -573,7 +573,7 @@ Client.prototype.makeClientStreamRequest = function(path, serialize, | |||
|   } | ||||
|   if (!((metadata instanceof Metadata) && | ||||
|        (options instanceof Object) && | ||||
|        (_.isFunction(callback)))) { | ||||
|        (typeof callback === 'function'))) { | ||||
|     throw new Error('Argument mismatch in makeClientStreamRequest'); | ||||
|   } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue