refactor: clean up gallery tooling and document the workflow
All checks were successful
Deploy on push / deploy (push) Has been skipped
All checks were successful
Deploy on push / deploy (push) Has been skipped
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user