grpc-js: Loosen requirements on channel option types

This commit is contained in:
Michael Lumish 2021-09-27 12:35:21 -07:00
parent fe198444dc
commit 8cc5f6cd24
1 changed files with 2 additions and 12 deletions

View File

@ -177,18 +177,8 @@ export class ChannelImplementation implements Channel {
);
}
if (options) {
if (
typeof options !== 'object' ||
!Object.values(options).every(
(value) =>
typeof value === 'string' ||
typeof value === 'number' ||
typeof value === 'undefined'
)
) {
throw new TypeError(
'Channel options must be an object with string or number values'
);
if (typeof options !== 'object') {
throw new TypeError('Channel options must be an object');
}
}
const originalTargetUri = parseUri(target);