From d522bd90c3b0cb08518f249ae5b90bd609fff165 Mon Sep 17 00:00:00 2001 From: Audrey Eschright Date: Tue, 8 Jan 2019 11:25:20 -0800 Subject: [PATCH] JSONStream@1.3.5 --- node_modules/JSONStream/index.js | 4 +++- node_modules/JSONStream/package.json | 27 ++++++++++++----------- node_modules/JSONStream/test/parsejson.js | 6 ++++- node_modules/JSONStream/test/run.js | 13 +++++++++++ package-lock.json | 6 ++--- package.json | 2 +- 6 files changed, 39 insertions(+), 19 deletions(-) create mode 100644 node_modules/JSONStream/test/run.js diff --git a/node_modules/JSONStream/index.js b/node_modules/JSONStream/index.js index c3bf14f968304..f4ed901f96560 100755 --- a/node_modules/JSONStream/index.js +++ b/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) { diff --git a/node_modules/JSONStream/package.json b/node_modules/JSONStream/package.json index 23588d31b13a4..91783af0b0ab6 100644 --- a/node_modules/JSONStream/package.json +++ b/node_modules/JSONStream/package.json @@ -1,28 +1,29 @@ { - "_from": "JSONStream@1.3.4", - "_id": "JSONStream@1.3.4", + "_from": "JSONStream@1.3.5", + "_id": "JSONStream@1.3.5", "_inBundle": false, - "_integrity": "sha512-Y7vfi3I5oMOYIr+WxV8NZxDSwcbNgzdKYsTNInmycOq9bUYwGg9ryu57Wg5NLmCjqdFPNUmpMBo3kSJN9tCbXg==", + "_integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "_location": "/JSONStream", "_phantomChildren": {}, "_requested": { "type": "version", "registry": true, - "raw": "JSONStream@1.3.4", + "raw": "JSONStream@1.3.5", "name": "JSONStream", "escapedName": "JSONStream", - "rawSpec": "1.3.4", + "rawSpec": "1.3.5", "saveSpec": null, - "fetchSpec": "1.3.4" + "fetchSpec": "1.3.5" }, "_requiredBy": [ "#USER", - "/" + "/", + "/npm-registry-fetch" ], - "_resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.4.tgz", - "_shasum": "615bb2adb0cd34c8f4c447b5f6512fa1d8f16a2e", - "_spec": "JSONStream@1.3.4", - "_where": "/Users/zkat/Documents/code/work/npm", + "_resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "_shasum": "3208c1f08d3a4d99261ab64f92302bc15e111ca0", + "_spec": "JSONStream@1.3.5", + "_where": "/Users/aeschright/code/cli", "author": { "name": "Dominic Tarr", "email": "dominic.tarr@gmail.com", @@ -69,7 +70,7 @@ "url": "git://github.com/dominictarr/JSONStream.git" }, "scripts": { - "test": "set -e; for t in test/*.js; do echo '***' $t '***'; node $t; done" + "test": "node test/run.js" }, - "version": "1.3.4" + "version": "1.3.5" } diff --git a/node_modules/JSONStream/test/parsejson.js b/node_modules/JSONStream/test/parsejson.js index a94333446df2a..e70dabc184624 100644 --- a/node_modules/JSONStream/test/parsejson.js +++ b/node_modules/JSONStream/test/parsejson.js @@ -9,6 +9,9 @@ var r = Math.random() , p = new Parser() , assert = require('assert') , times = 20 + , bufferFrom = Buffer.from && Buffer.from !== Uint8Array.from + , str + while (times --) { assert.equal(JSON.parse(JSON.stringify(r)), r, 'core JSON') @@ -18,7 +21,8 @@ while (times --) { assert.equal(v,r) } console.error('correct', r) - p.write (new Buffer(JSON.stringify([r]))) + str = JSON.stringify([r]) + p.write (bufferFrom ? Buffer.from(str) : new Buffer(str)) diff --git a/node_modules/JSONStream/test/run.js b/node_modules/JSONStream/test/run.js new file mode 100644 index 0000000000000..7d62e7385bd44 --- /dev/null +++ b/node_modules/JSONStream/test/run.js @@ -0,0 +1,13 @@ +var readdirSync = require('fs').readdirSync +var spawnSync = require('child_process').spawnSync +var extname = require('path').extname + +var files = readdirSync(__dirname) +files.forEach(function(file){ + if (extname(file) !== '.js' || file === 'run.js') + return + console.log(`*** ${file} ***`) + var result = spawnSync(process.argv0, [file], { stdio: 'inherit', cwd: __dirname} ) + if (result.status !== 0) + process.exit(result.status) +}) diff --git a/package-lock.json b/package-lock.json index 68bf1df87e424..d748186e1e965 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,9 +44,9 @@ "dev": true }, "JSONStream": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.4.tgz", - "integrity": "sha512-Y7vfi3I5oMOYIr+WxV8NZxDSwcbNgzdKYsTNInmycOq9bUYwGg9ryu57Wg5NLmCjqdFPNUmpMBo3kSJN9tCbXg==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "requires": { "jsonparse": "^1.2.0", "through": ">=2.2.7 <3" diff --git a/package.json b/package.json index 89684e63d7cd4..a81cc736cf5db 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "npx": "./bin/npx-cli.js" }, "dependencies": { - "JSONStream": "^1.3.4", + "JSONStream": "^1.3.5", "abbrev": "~1.1.1", "ansicolors": "~0.3.2", "ansistyles": "~0.1.3",