refactor: drop usage of _.isFinite

This commit is contained in:
Justin Beckwith 2018-11-09 16:57:24 -08:00
parent 494b97ac1a
commit ea3e8e5997
3 changed files with 4 additions and 4 deletions

View File

@ -944,7 +944,7 @@ function _getClientStreamingInterceptor(method_definition, channel, emitter,
callback(e);
return;
}
if (_.isFinite(encoding)) {
if (Number.isFinite(encoding)) {
/* Attach the encoding if it is a finite number. This is the closest we
* can get to checking that it is valid flags */
message.grpcWriteFlags = encoding;
@ -1145,7 +1145,7 @@ function _getBidiStreamingInterceptor(method_definition, channel, emitter) {
callback(e);
return;
}
if (_.isFinite(encoding)) {
if (Number.isFinite(encoding)) {
/* Attach the encoding if it is a finite number. This is the closest we
* can get to checking that it is valid flags */
message.grpcWriteFlags = encoding;

View File

@ -170,7 +170,7 @@ exports.createFromMetadataGenerator = function(metadata_generator) {
var message = '';
if (error) {
message = error.message;
if (error.hasOwnProperty('code') && _.isFinite(error.code)) {
if (error.hasOwnProperty('code') && Number.isFinite(error.code)) {
code = error.code;
} else {
code = constants.status.UNAUTHENTICATED;

View File

@ -318,7 +318,7 @@ function _write(chunk, encoding, callback) {
(new Metadata())._getCoreRepresentation();
this.call.metadataSent = true;
}
if (_.isFinite(encoding)) {
if (Number.isFinite(encoding)) {
/* Attach the encoding if it is a finite number. This is the closest we
* can get to checking that it is valid flags */
message.grpcWriteFlags = encoding;