Skip to content

Commit

Permalink
Merge pull request #1916 from murgatroid99/grpc-js_channel_options_pe…
Browse files Browse the repository at this point in the history
…rmissive

grpc-js: Loosen requirements on channel option types
  • Loading branch information
murgatroid99 committed Sep 27, 2021
2 parents fe19844 + 8cc5f6c commit 255618e
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions packages/grpc-js/src/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 255618e

Please sign in to comment.