From: Feross Aboukhadijeh Date: Wed, 11 Feb 2015 23:01:33 +0000 (-0800) Subject: style X-Git-Url: https://zoso.dev/?a=commitdiff_plain;h=80c8e3c646b350c858b738585ecd94d4fb00fd32;p=buffer.git style --- diff --git a/index.js b/index.js index 21c8a09..a2c9324 100644 --- a/index.js +++ b/index.js @@ -72,9 +72,9 @@ function Buffer (subject, encoding, noZero) { // Find the length var length - if (type === 'number') + if (type === 'number') { length = +subject - else if (type === 'string') { + } else if (type === 'string') { length = Buffer.byteLength(subject, encoding) } else if (type === 'object' && subject !== null) { // assume object is array-like if (subject.type === 'Buffer' && isArray(subject.data))