@antora/ui-loader 3.1.13 → 3.1.15

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.
Files changed (2) hide show
  1. package/lib/load-ui.js +2 -1
  2. package/package.json +2 -2
package/lib/load-ui.js CHANGED
@@ -15,6 +15,7 @@ const { posix: path } = ospath
15
15
  const picomatch = require('picomatch')
16
16
  const posixify = ospath.sep === '\\' ? (p) => p.replace(/\\/g, '/') : undefined
17
17
  const { pipeline, PassThrough, Writable } = require('stream')
18
+ const drain = () => new Writable({ objectMode: true, write: (_chunk, _enc, next) => next() })
18
19
  const forEach = (write, final) => new Writable({ objectMode: true, write, final })
19
20
  const through = () => new PassThrough({ objectMode: true })
20
21
  const UiCatalog = require('./ui-catalog')
@@ -330,7 +331,7 @@ function srcFs (cwd) {
330
331
 
331
332
  function srcZip (file, options = {}) {
332
333
  const result = options.testOnly
333
- ? forEach((file_, _, done) => (file_.isStream() ? file_.contents.pipe(through()).on('finish', done) : done()))
334
+ ? forEach((file_, _, done) => (file_.isStream() ? pipeline(file_.contents, through(), drain(), done) : done()))
334
335
  : through()
335
336
  yauzl[file instanceof Buffer ? 'fromBuffer' : 'open'](file, { lazyEntries: true }, (err, zipFile) => {
336
337
  if (err) return result.emit('error', err)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antora/ui-loader",
3
- "version": "3.1.13",
3
+ "version": "3.1.15",
4
4
  "description": "Downloads a UI bundle, if necessary, and loads the files into a UI catalog for use in an Antora documentation pipeline.",
5
5
  "license": "MPL-2.0",
6
6
  "author": "OpenDevise Inc. (https://opendevise.com)",
@@ -38,7 +38,7 @@
38
38
  "should-proxy": "~1.0",
39
39
  "simple-get": "~4.0",
40
40
  "vinyl": "~3.0",
41
- "yauzl": "~3.1"
41
+ "yauzl": "~3.3"
42
42
  },
43
43
  "engines": {
44
44
  "node": ">=16.0.0"