Skip to content

Commit

Permalink
backport buffer-from-number fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mafintosh committed Mar 1, 2018
1 parent 71d37be commit 4c4ed11
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ function stringConcat (parts) {
strings.push(p)
} else if (Buffer.isBuffer(p)) {
strings.push(p)
} else {
} else if (typeof p !== 'number') {
strings.push(Buffer(p))
} else {
strings.push(Buffer(String(p)))
}
}
if (Buffer.isBuffer(parts[0])) {
Expand Down

0 comments on commit 4c4ed11

Please sign in to comment.