progress with versioning lib

This commit is contained in:
Joeri Exelmans 2025-06-06 15:30:35 +02:00
parent 3623988f86
commit 618cdf7314
7 changed files with 236 additions and 91 deletions

View file

@ -28,3 +28,13 @@ export const makeGetters = fieldNames => {
}[getterName];
})
};
export const makeStructCompareFn = compares => {
return a => b => {
for (const {l: fieldName, r: getCompareFn} of compares) {
const cmp = getCompareFn()(a[fieldName])(b[fieldName]);
if (cmp !== 0) return cmp;
}
return 0;
}
}