From 80d7057cad4c71139b1544407279fed51908e758 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 29 Jul 2019 13:50:51 -0700 Subject: [PATCH] Use typeof instead of util functions --- packages/grpc-js/src/server-call.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/grpc-js/src/server-call.ts b/packages/grpc-js/src/server-call.ts index 34d13b781..c9a6b3f75 100644 --- a/packages/grpc-js/src/server-call.ts +++ b/packages/grpc-js/src/server-call.ts @@ -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'; @@ -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!; } }