diff options
Diffstat (limited to 'deps/npm/node_modules/JSONStream/index.js')
-rwxr-xr-x | deps/npm/node_modules/JSONStream/index.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/deps/npm/node_modules/JSONStream/index.js b/deps/npm/node_modules/JSONStream/index.js index a92967f568..8c587af769 100755 --- a/deps/npm/node_modules/JSONStream/index.js +++ b/deps/npm/node_modules/JSONStream/index.js @@ -3,6 +3,8 @@ var Parser = require('jsonparse') , through = require('through') +var bufferFrom = Buffer.from && Buffer.from !== Uint8Array.from + /* the value of this.stack that creationix's jsonparse has is weird. @@ -17,7 +19,7 @@ exports.parse = function (path, map) { var parser = new Parser() var stream = through(function (chunk) { if('string' === typeof chunk) - chunk = new Buffer(chunk) + chunk = bufferFrom ? Buffer.from(chunk) : new Buffer(chunk) parser.write(chunk) }, function (data) { |