refactor: drop usage of _.startsWith

This commit is contained in:
Justin Beckwith 2018-11-09 17:12:34 -08:00
parent 494b97ac1a
commit 261fb51ba9
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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();
});
});