diff --git a/src/helpers/versionTree.js b/src/helpers/versionTree.js index 3384a7d..d5810b1 100644 --- a/src/helpers/versionTree.js +++ b/src/helpers/versionTree.js @@ -1,16 +1,5 @@ 'use strict' -module.exports = (components) => versionTree(components) - -function versionTree (components) { - return components.map((comp) => { - return { - ...comp, - versions: splitVersions(comp.versions), - } - }) -} - function splitVersions (versions) { const snapshot = versions.filter((v) => v.version.includes('SNAPSHOT')) const stable = versions.filter((v) => { @@ -25,3 +14,12 @@ function splitVersions (versions) { preview: preview.length > 0 ? preview : null, } } + +module.exports = (components) => { + return Object.values(components)?.map((comp) => { + return { + ...comp, + versions: splitVersions(comp.versions), + } + }) +} diff --git a/src/partials/version.hbs b/src/partials/version.hbs index 3a54416..0da5636 100644 --- a/src/partials/version.hbs +++ b/src/partials/version.hbs @@ -7,52 +7,23 @@