From 8f724121a28e54343ee4c8e4fb97126006480b2d Mon Sep 17 00:00:00 2001 From: Dmitry Cheryasov Date: Mon, 20 May 2019 15:36:15 -0500 Subject: [PATCH] Fix a TypeError loading a non-existent proto file. The issue: https://github.com/grpc/grpc-node/issues/876 This is an obvious typo; `typeof` has to return a string `'undefined'`, not a literal `undefined.` --- packages/proto-loader/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/proto-loader/src/index.ts b/packages/proto-loader/src/index.ts index 563f58f57..4e17719ef 100644 --- a/packages/proto-loader/src/index.ts +++ b/packages/proto-loader/src/index.ts @@ -121,7 +121,7 @@ function getAllHandledReflectionObjects( if (isHandledReflectionObject(obj)) { return [[objName, obj]]; } else { - if (isNamespaceBase(obj) && typeof obj.nested !== undefined) { + if (isNamespaceBase(obj) && typeof obj.nested !== 'undefined') { return Object.keys(obj.nested!) .map((name) => { return getAllHandledReflectionObjects(obj.nested![name], objName);