progress with versioning lib
This commit is contained in:
parent
3623988f86
commit
618cdf7314
7 changed files with 236 additions and 91 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue