Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@antora/ui-loader

Package Overview
Dependencies
Maintainers
2
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antora/ui-loader - npm Package Compare versions

Comparing version 2.3.0-alpha.1 to 2.3.0-alpha.2

6

lib/load-ui.js

@@ -136,5 +136,5 @@ 'use strict'

function downloadBundle (url, to) {
return get(url, { encoding: null })
return get(url, { resolveBodyOnly: true, responseType: 'buffer' })
.then(
({ body }) =>
(body) =>
new Promise((resolve, reject) =>

@@ -207,3 +207,3 @@ new ReadableFile(new MemoryFile({ path: ospath.basename(to), contents: body }))

const files = new Map()
return map((file, _, next) => files.set(file.path, file) && next(), () => done(files))
return map((file, _, next) => files.set(file.path, file) && next(), () => done(files)) // prettier-ignore
}

@@ -210,0 +210,0 @@

'use strict'
const _ = require('lodash')
const $files = Symbol('files')
const $generateId = Symbol('generateId')
class UiCatalog {
constructor () {
this[$files] = {}
this[$files] = new Map()
}
getFiles () {
return Object.values(this[$files])
getAll () {
return [...this[$files].values()]
}
addFile (file) {
const id = this[$generateId](file)
if (id in this[$files]) {
const key = generateKey(file)
if (this[$files].has(key)) {
throw new Error('Duplicate file')
}
this[$files][id] = file
this[$files].set(key, file)
}
findByType (type) {
return _.filter(this[$files], { type })
const accum = []
for (const entry of this[$files]) {
const candidate = entry[1]
if (candidate.type === type) accum.push(candidate)
}
return accum
}
}
[$generateId] (file) {
return [file.type, ...file.path.split('/')]
}
/**
* @deprecated superceded by getAll
*/
UiCatalog.prototype.getFiles = UiCatalog.prototype.getAll
function generateKey ({ type, path }) {
return `${type}$${path}`
}
module.exports = UiCatalog
{
"name": "@antora/ui-loader",
"version": "2.3.0-alpha.1",
"version": "2.3.0-alpha.2",
"description": "Downloads a UI bundle, if necessary, and loads the files into a UI catalog for use in an Antora documentation pipeline.",

@@ -24,6 +24,5 @@ "license": "MPL-2.0",

"fs-extra": "~8.1",
"got": "~9.6",
"gulp-vinyl-zip": "~2.1 >=2.1.3",
"got": "~10.0",
"gulp-vinyl-zip": "~2.2",
"js-yaml": "~3.13",
"lodash": "~4.17",
"minimatch-all": "~1.1",

@@ -30,0 +29,0 @@ "through2": "~3.0",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc