(licenses: Set<string>)
| 134 | } |
| 135 | |
| 136 | function sortLicenses(licenses: Set<string>) { |
| 137 | let withParenthesis: string[] = [] |
| 138 | let noParenthesis: string[] = [] |
| 139 | licenses.forEach((license) => { |
| 140 | if (license[0] === '(') { |
| 141 | withParenthesis.push(license) |
| 142 | } else { |
| 143 | noParenthesis.push(license) |
| 144 | } |
| 145 | }) |
| 146 | withParenthesis = withParenthesis.sort() |
| 147 | noParenthesis = noParenthesis.sort() |
| 148 | return [...noParenthesis, ...withParenthesis] |
| 149 | } |
| 150 | |
| 151 | interface DependencyInfo { |
| 152 | license?: string |