@rnx-kit/third-party-notices
Advanced tools
Comparing version 1.3.1 to 1.3.2
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createLicenseFileContents = void 0; | ||
const os_1 = __importDefault(require("os")); | ||
const EOL = "\n"; | ||
const SEPARATOR = `${EOL}${EOL}========================================================================${EOL}${EOL}`; | ||
function createLicenseFileContents(licenses, preambleText, additionalText) { | ||
let outputText = ""; | ||
const writeLine = (s) => { | ||
outputText += `${s || ""}${os_1.default.EOL}`; | ||
}; | ||
const writeMultipleLines = (s) => { | ||
const lines = s.split(/\r\n|\r|\n/g); | ||
lines.forEach((line) => { | ||
writeLine(line); | ||
}); | ||
}; | ||
if (preambleText) { | ||
writeMultipleLines(preambleText.join(os_1.default.EOL)); | ||
} | ||
const output = preambleText ? [preambleText.join(EOL)] : []; | ||
// Emit combined license text | ||
@@ -34,15 +20,12 @@ licenses.forEach(({ name, version, license, licenseText, licenseURLs }) => { | ||
} | ||
writeLine("================================================"); | ||
writeLine(`${name} ${version}`); | ||
writeLine("--"); | ||
writeMultipleLines(licenseText.trim()); | ||
writeLine("================================================"); | ||
writeLine(""); | ||
const trimmedText = licenseText.replace(/\r\n|\r|\n/g, EOL).trim(); | ||
output.push(`${name} ${version}${EOL}--${EOL}${trimmedText}`); | ||
}); | ||
if (additionalText) { | ||
writeMultipleLines(additionalText.join(os_1.default.EOL)); | ||
output.push(additionalText.join(EOL)); | ||
} | ||
return outputText; | ||
// Always add a newline at the end | ||
return output.join(SEPARATOR) + EOL; | ||
} | ||
exports.createLicenseFileContents = createLicenseFileContents; | ||
//# sourceMappingURL=text.js.map |
{ | ||
"name": "@rnx-kit/third-party-notices", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"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", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
50181
606