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