projectz
Version:
Stop wasting time syncing and updating your project's README and Package Files!
34 lines (33 loc) • 1.14 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getHistorySection = void 0;
// external
const render_1 = require("@bevry/render");
const util_js_1 = require("./util.js");
// Get History Section
function getHistorySection(data) {
let link;
const file = data.filenamesForReadmeFiles.history;
if (file) {
link = (0, render_1.ma)({
url: (0, util_js_1.fileUrl)(data, file),
inner: (0, render_1.t)([
'Discover the release history by heading on over to the',
(0, render_1.mcode)(file),
'file.',
]),
});
}
else if (data.github.slug) {
link = (0, render_1.ma)({
url: `https://github.com/${data.github.slug}/releases`,
inner: 'Discover the release history by heading on over to the releases page.',
});
}
else {
throw new Error('History section either requires a HISTORY file or a Github repository');
}
// Return
return (0, render_1.lines)([(0, render_1.mh2)('History'), link]);
}
exports.getHistorySection = getHistorySection;
;