lighthouse 9.2.0-dev.20220111 → 9.2.0-dev.20220115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,6 +19,8 @@ const LHError = require('../lib/lh-error.js');
19
19
  // TODO(esmodules): Rollup does not support `promisfy` or `stream.pipeline`. Bundled files
20
20
  // don't need anything in this file except for `stringifyReplacer`, so a check for
21
21
  // truthiness before using is enough.
22
+ // TODO: Can remove promisify(pipeline) in Node 15.
23
+ // https://nodejs.org/api/stream.html#streams-promises-api
22
24
  const pipeline = promisify && promisify(stream.pipeline);
23
25
 
24
26
  const artifactsFilename = 'artifacts.json';
@@ -238,8 +240,6 @@ async function saveTrace(traceData, traceFilename) {
238
240
  const traceIter = traceJsonGenerator(traceData);
239
241
  const writeStream = fs.createWriteStream(traceFilename);
240
242
 
241
- // TODO: Can remove promisify(pipeline) in Node 15.
242
- // https://nodejs.org/api/stream.html#stream_stream_pipeline_streams_callback
243
243
  return pipeline(traceIter, writeStream);
244
244
  }
245
245
 
@@ -250,10 +250,12 @@ async function saveTrace(traceData, traceFilename) {
250
250
  * @return {Promise<void>}
251
251
  */
252
252
  function saveDevtoolsLog(devtoolsLog, devtoolLogFilename) {
253
- const logIter = arrayOfObjectsJsonGenerator(devtoolsLog);
254
253
  const writeStream = fs.createWriteStream(devtoolLogFilename);
255
254
 
256
- return pipeline(logIter, writeStream);
255
+ return pipeline(function* () {
256
+ yield* arrayOfObjectsJsonGenerator(devtoolsLog);
257
+ yield '\n';
258
+ }, writeStream);
257
259
  }
258
260
 
259
261
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lighthouse",
3
- "version": "9.2.0-dev.20220111",
3
+ "version": "9.2.0-dev.20220115",
4
4
  "description": "Automated auditing, performance metrics, and best practices for the web.",
5
5
  "main": "./lighthouse-core/index.js",
6
6
  "bin": {