@antora/navigation-builder
Advanced tools
Comparing version 2.3.0-alpha.1 to 2.3.0-alpha.2
'use strict' | ||
const $sets = Symbol('sets') | ||
const $generateId = Symbol('generateId') | ||
@@ -12,4 +11,4 @@ class NavigationCatalog { | ||
addTree (component, version, tree) { | ||
const id = this[$generateId](component, version) | ||
const navigation = this[$sets][id] || (this[$sets][id] = []) | ||
const key = generateKey(component, version) | ||
const navigation = this[$sets][key] || (this[$sets][key] = []) | ||
// NOTE retain order on insert | ||
@@ -22,15 +21,14 @@ const insertIdx = navigation.findIndex((candidate) => candidate.order >= tree.order) | ||
addNavigation (component, version, trees) { | ||
return (this[$sets][this[$generateId](component, version)] = trees.sort((a, b) => a.order - b.order)) | ||
return (this[$sets][generateKey(component, version)] = trees.sort((a, b) => a.order - b.order)) | ||
} | ||
getNavigation (component, version) { | ||
const id = this[$generateId](component, version) | ||
return this[$sets][id] | ||
return this[$sets][generateKey(component, version)] | ||
} | ||
} | ||
[$generateId] (component, version) { | ||
return version + '@' + component | ||
} | ||
function generateKey (component, version) { | ||
return version + '@' + component | ||
} | ||
module.exports = NavigationCatalog |
{ | ||
"name": "@antora/navigation-builder", | ||
"version": "2.3.0-alpha.1", | ||
"version": "2.3.0-alpha.2", | ||
"description": "Builds a navigation catalog from navigation files for adding site navigation to pages in an Antora documentation pipeline.", | ||
@@ -18,3 +18,3 @@ "license": "MPL-2.0", | ||
"dependencies": { | ||
"@antora/asciidoc-loader": "2.3.0-alpha.1" | ||
"@antora/asciidoc-loader": "2.3.0-alpha.2" | ||
}, | ||
@@ -21,0 +21,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7619
145
+ Added@antora/asciidoc-loader@2.3.0-alpha.2(transitive)
- Removed@antora/asciidoc-loader@2.3.0-alpha.1(transitive)