(licenses)
| 275 | } |
| 276 | |
| 277 | function sortLicenses(licenses) { |
| 278 | let withParenthesis = [] |
| 279 | let noParenthesis = [] |
| 280 | licenses.forEach((license) => { |
| 281 | if (/^\(/.test(license)) { |
| 282 | withParenthesis.push(license) |
| 283 | } |
| 284 | else { |
| 285 | noParenthesis.push(license) |
| 286 | } |
| 287 | }) |
| 288 | withParenthesis = withParenthesis.sort() |
| 289 | noParenthesis = noParenthesis.sort() |
| 290 | return [...noParenthesis, ...withParenthesis] |
| 291 | } |
no test coverage detected