( bundles )
| 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 |
no test coverage detected