refactor: clean up gallery tooling and document the workflow
All checks were successful
Deploy on push / deploy (push) Has been skipped

This commit is contained in:
2026-03-22 20:33:29 -07:00
parent b3a8368bab
commit 614a3d1eff
7 changed files with 397 additions and 7 deletions

View File

@@ -99,6 +99,20 @@ function syncEloWithMeals(meals) {
return syncedData;
}
function getEloAlignmentReport(meals, eloData) {
const mealIds = new Set(meals.map((meal) => meal.id));
const eloIds = new Set(eloData.entries.map((entry) => entry.id));
return {
missingEntryIds: meals
.map((meal) => meal.id)
.filter((mealId) => !eloIds.has(mealId)),
unexpectedEntryIds: eloData.entries
.map((entry) => entry.id)
.filter((entryId) => !mealIds.has(entryId)),
};
}
function compareRankedMeals(left, right) {
if (right.rating !== left.rating) {
return right.rating - left.rating;
@@ -132,6 +146,7 @@ function getRankedMeals(meals, eloData) {
module.exports = {
eloPath,
getEloAlignmentReport,
getRankedMeals,
loadEloData,
saveEloData,