* Build the license template params * @param {String|Object} spdxLicense - SPDX license id or object * @param {Array} customLicenseLines
(spdxLicense, customLicenseLines = [])
| 111 | * @param {Array} customLicenseLines |
| 112 | */ |
| 113 | function expandLicense(spdxLicense, customLicenseLines = []) { |
| 114 | if (typeof spdxLicense === 'string') { |
| 115 | spdxLicense = spdxLicenseList[spdxLicense.toLowerCase()]; |
| 116 | } |
| 117 | if (spdxLicense && spdxLicense.id !== 'CUSTOM') { |
| 118 | return { |
| 119 | template: LICENSED, |
| 120 | license: spdxLicense.name, |
| 121 | url: spdxLicense.url, |
| 122 | }; |
| 123 | } |
| 124 | return { |
| 125 | template: getCustomTemplate(customLicenseLines), |
| 126 | license: spdxLicense, |
| 127 | }; |
| 128 | } |
| 129 | |
| 130 | /** |
| 131 | * Format the header for a file |
no test coverage detected