MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / cleanupVersionBlock

Function cleanupVersionBlock

scripts/format-changelog.js:252–274  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

250}
251
252function cleanupVersionBlock(version) {
253 // Sort the references first, numbers come before sub project refs.
254 version.entries.forEach(entry => entry.refs.sort((a, b) => referenceSort(a, b)));
255
256 // Sort the entries by change type.
257 version.entries.sort((a, b) => reorderGroups(a, b));
258
259 // Ensure entries end with a dot.
260 version.entries.forEach(entry => {
261 var desc = entry.description;
262 var originalBug = false;
263 if (desc.endsWith("(original bug)")) {
264 originalBug = true;
265 entry.description = desc.substring(0, desc.indexOf("(original bug")).trim();
266 }
267 if (!entry.description.endsWith(".")) {
268 entry.description += ".";
269 }
270 if (originalBug) {
271 entry.description += " (original bug)";
272 }
273 });
274}
275
276function cleanupVersions(versions) {
277 for (const version of versions) {

Callers 1

cleanupVersionsFunction · 0.85

Calls 4

referenceSortFunction · 0.85
reorderGroupsFunction · 0.85
trimMethod · 0.80
indexOfMethod · 0.80

Tested by

no test coverage detected