MCPcopy Create free account
hub / github.com/loopbackio/loopback-next / expandLicense

Function expandLicense

packages/cli/generators/copyright/header.js:113–128  ·  view source on GitHub ↗

* Build the license template params * @param {String|Object} spdxLicense - SPDX license id or object * @param {Array} customLicenseLines

(spdxLicense, customLicenseLines = [])

Source from the content-addressed store, hash-verified

111 * @param {Array} customLicenseLines
112 */
113function 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

Callers 1

buildHeaderFunction · 0.85

Calls 2

getCustomTemplateFunction · 0.85
toLowerCaseMethod · 0.80

Tested by

no test coverage detected