mirror of https://github.com/grpc/grpc-node.git
grpc-js: Loosen requirements on channel option types
This commit is contained in:
parent
fe198444dc
commit
8cc5f6cd24
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue