mirror of https://github.com/grpc/grpc-node.git
				
				
				
			refactor: drop usage of _.startsWith
This commit is contained in:
		
							parent
							
								
									494b97ac1a
								
							
						
					
					
						commit
						261fb51ba9
					
				|  | @ -935,7 +935,7 @@ exports.makeClientConstructor = function(methods, serviceName, | |||
|   ServiceClient.prototype.$method_names = {}; | ||||
| 
 | ||||
|   _.each(methods, function(attrs, name) { | ||||
|     if (_.startsWith(name, '$')) { | ||||
|     if (name.indexOf('$') === 0) { | ||||
|       throw new Error('Method names cannot start with $'); | ||||
|     } | ||||
|     var method_type = common.getMethodType(attrs); | ||||
|  |  | |||
|  | @ -489,8 +489,8 @@ describe('Echo metadata', function() { | |||
|     var call = client.unary({}, metadata, | ||||
|                             function(err, data) { assert.ifError(err); }); | ||||
|     call.on('metadata', function(metadata) { | ||||
|       assert(_.startsWith(metadata.get('user-agent')[0], | ||||
|                           'grpc-node/' + version)); | ||||
|       assert.strictEqual(0, | ||||
|         metadata.get('user-agent')[0].indexOf('grpc-node/' + version)); | ||||
|       done(); | ||||
|     }); | ||||
|   }); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue