Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compoundEval is not correctly implemented #923

Open
Losses opened this issue Dec 5, 2022 · 0 comments
Open

compoundEval is not correctly implemented #923

Losses opened this issue Dec 5, 2022 · 0 comments

Comments

@Losses
Copy link

Losses commented Dec 5, 2022

Prosperities value is passed to compoundEval here, the type signature of the value is ([keyof Document, isDesc] | keyof Document)[].

LokiJS/src/lokijs.js

Lines 3364 to 3369 in 25b9a33

var wrappedComparer =
(function (props, data) {
return function (a, b) {
return compoundeval(props, data[a], data[b]);
};
})(properties, this.collection.data);

But compoundEval only support [keyof Document, isDesc][]:

field = prop[0];

res = sortHelper(val1, val2, prop[1]);

But do not support (keyof Document)[].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant