mirror of
https://github.com/uber-common/node-kafka-rest-client.git
synced 2025-12-08 20:59:54 +00:00
addressing mingmin's comments
This commit is contained in:
parent
75a5a3371b
commit
c54792eee8
@ -36,7 +36,7 @@ ProducerRecord.prototype.validate = function validate() {
|
||||
if (typeof self.value !== 'string' && !Buffer.isBuffer(self.value)) {
|
||||
return new Error('ProducerRecord value is neither string nor byte array');
|
||||
}
|
||||
if (self.key !== undefined && typeof self.value !== 'string') {
|
||||
if (self.key !== undefined && typeof self.key !== 'string' && !Buffer.isBuffer(self.key)) {
|
||||
return new Error('ProducerRecord value is neither string');
|
||||
}
|
||||
return null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user