Skip to content

Commit

Permalink
replace new Buffer() calls with Buffer.from() to resolve depreciation…
Browse files Browse the repository at this point in the history
… warnings in tests (#33)
  • Loading branch information
moonmeister authored Jan 22, 2021
1 parent 8042b80 commit 2fc901a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var test = curry(function(words, options, expect, done) {
chunks = generateChunks(words)
}
else {
chunks = [new Buffer(words)]
chunks = [Buffer.from(words)]
if (~words.indexOf(' ')) {
words = words.split(/.+ +.+/g).length + 1
}
Expand Down Expand Up @@ -72,7 +72,7 @@ function generateChunks(words) {
chunks.push(chunk)

return chunks.map(function(chunk) {
return new Buffer(chunk)
return Buffer.from(chunk)
})
}

Expand Down

0 comments on commit 2fc901a

Please sign in to comment.