MCPcopy
hub / github.com/ThatGuySam/doesitarm / sortBundleVersions

Method sortBundleVersions

build-lists.js:244–265  ·  view source on GitHub ↗
( bundles )

Source from the content-addressed store, hash-verified

242 }
243
244 sortBundleVersions ( bundles ) {
245 return bundles.map( bundle => {
246 const [
247 bundleIdentifier,
248 versionsObject
249 ] = bundle
250
251 // Sort versions by semver
252 const versions = Object.entries( versionsObject ).sort( ( [ aVersionRaw ], [ bVersionRaw ] ) => {
253 // console.log( 'a, b', aVersionRaw, bVersionRaw )
254 const aVersion = normalizeVersion( aVersionRaw )
255 const bVersion = normalizeVersion( bVersionRaw )
256
257 return semver.compare( bVersion, aVersion )
258 } )
259
260 return [
261 bundleIdentifier,
262 versions
263 ]
264 } )
265 }
266
267 saveToJson = async function ( content, path ) {
268

Callers 1

BuildListsClass · 0.95

Calls 1

normalizeVersionFunction · 0.85

Tested by

no test coverage detected