Skip to content

Commit

Permalink
use ternary for buffer.from check
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Mar 2, 2018
1 parent 43cd269 commit 00d08fa
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@ var eos = require('end-of-stream')
var inherits = require('inherits')
var shift = require('stream-shift')

var SIGNAL_FLUSH
if (Buffer.from && Buffer.from !== Uint8Array.from) {
SIGNAL_FLUSH = Buffer.from([0])
} else {
SIGNAL_FLUSH = new Buffer([0])
}
var SIGNAL_FLUSH = (Buffer.from && Buffer.from !== Uint8Array.from)
? Buffer.from([0])
: new Buffer([0])

var onuncork = function(self, fn) {
if (self._corked) self.once('uncork', fn)
Expand Down

0 comments on commit 00d08fa

Please sign in to comment.