Merge pull request #621 from JustinBeckwith/startsWith

refactor: drop usage of _.startsWith
This commit is contained in:
Michael Lumish 2018-11-12 17:15:28 -08:00 committed by GitHub
commit f70eabb1ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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();
});
});