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

Cmp instead of idb #2076

Merged
merged 4 commits into from
Sep 30, 2024
Merged

Cmp instead of idb #2076

merged 4 commits into from
Sep 30, 2024

Conversation

ankitjha420
Copy link

This PR aims to fix issue #2064
What I've changed is basically the comparison function, from idb.cmp() to cmp() defined at src/functions/cmp.ts

function equals (a, b) {
return idb.cmp(a,b) === 0; // Works with all indexable types including binary keys.
return cmp(a, b); // Works with all indexable types including binary keys.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean cmp(a, b) === 0; ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dumb mistake on my part, fixed it. sorry about that

@dfahlander
Copy link
Collaborator

Thanks for the fix. I think this was the last place where we are using idb.cmp. If you have time, could you check if we could also get rid of the line const idb = this.db._deps.indexedDB;. I believe it's not needed anymore.

@ankitjha420
Copy link
Author

I've checked it out and it's not being used anywhere else in table.ts, so removed it

@dfahlander dfahlander merged commit d6a7387 into dexie:master Sep 30, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

3 participants