Skip to content

Commit

Permalink
Use typeof instead of util functions
Browse files Browse the repository at this point in the history
  • Loading branch information
murgatroid99 committed Jul 29, 2019
1 parent 0dc0b68 commit 80d7057
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/grpc-js/src/server-call.ts
Expand Up @@ -18,7 +18,6 @@
import { EventEmitter } from 'events';
import * as http2 from 'http2';
import { Duplex, Readable, Writable } from 'stream';
import * as util from 'util';

import { StatusObject } from './call-stream';
import { Status } from './constants';
Expand Down Expand Up @@ -506,11 +505,11 @@ export class Http2ServerCallStream<
: new Metadata(),
};

if ('code' in error && util.isNumber(error.code) && Number.isInteger(error.code)) {
if ('code' in error && typeof error.code === 'number' && Number.isInteger(error.code)) {
status.code = error.code;

if ('details' in error && util.isString(error.details)) {
status.details = error.details;
if ('details' in error && typeof error.details === 'string') {
status.details = error.details!;
}
}

Expand Down

0 comments on commit 80d7057

Please sign in to comment.