Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 162cd97

Browse files
committed
Simplify buffer handling
1 parent 4bb4dab commit 162cd97

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/api/pubsub.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,8 @@ module.exports = (send, config) => {
8484
options = {}
8585
}
8686

87-
let buf
88-
if (Buffer.isBuffer(data)) {
89-
buf = data
90-
} else {
91-
buf = new Buffer(data)
92-
}
87+
const isBuffer = Buffer.isBuffer(data)
88+
const buf = isBuffer ? data : new Buffer(data)
9389

9490
send({
9591
path: 'pubsub/pub',

0 commit comments

Comments
 (0)