@rnx-kit/third-party-notices
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -18,6 +18,13 @@ "use strict"; | ||
} | ||
function parseCopyright(modulePath, licenseText) { | ||
function parseCopyright(modulePath, licenseText, license, licenseURLs) { | ||
const m = licenseText === null || licenseText === void 0 ? void 0 : licenseText.match(/^Copyright .*$/m); | ||
if (!m) { | ||
return getPackageAuthor(modulePath) || "No copyright notice"; | ||
const packageAuthor = getPackageAuthor(modulePath); | ||
if (packageAuthor) { | ||
return packageAuthor; | ||
} | ||
if ((licenseURLs === null || licenseURLs === void 0 ? void 0 : licenseURLs.length) > 0) { | ||
return `${license} (${licenseURLs.join(" ")})`; | ||
} | ||
return "No copyright notice"; | ||
} | ||
@@ -28,3 +35,3 @@ return m[0].trim(); | ||
return JSON.stringify({ | ||
packages: licenses.map(({ name, path: modulePath, version, license, licenseText }) => { | ||
packages: licenses.map(({ name, path: modulePath, version, license, licenseText, licenseURLs, }) => { | ||
if (!license) { | ||
@@ -37,3 +44,3 @@ throw new Error(`No license for ${name}`); | ||
license, | ||
copyright: parseCopyright(modulePath, licenseText), | ||
copyright: parseCopyright(modulePath, licenseText, license, licenseURLs), | ||
}; | ||
@@ -40,0 +47,0 @@ if (fullLicenseText) { |
{ | ||
"name": "@rnx-kit/third-party-notices", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Library and tool to build a third party notices file based on a js bundle's source map", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/microsoft/rnx-kit/tree/main/packages/third-party-notices#readme", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33263
646