We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Pretty straightforward. A polyfill would be like:
IDBKeyRange.prototype.includes = function(key) { var r = this, c; if (r.lower !== undefined) { c = indexedDB.cmp(key, r.lower) if (r.lowerOpen && c <= 0) return false; if (!r.lowerOpen && c < 0) return false; } if (r.upper !== undefined) { c = indexedDB.cmp(key, r.upper) if (r.upperOpen && c >= 0) return false; if (!r.upperOpen && c > 0) return false; } return true; };
And some sample cases:
// basic cases IDBKeyRange.bound(12, 34).includes(11); // false IDBKeyRange.bound(12, 34).includes(12); // true IDBKeyRange.bound(12, 34).includes(22); // true IDBKeyRange.bound(12, 34).includes(44); // false // closed bound (inclusive) IDBKeyRange.lowerBound(12).includes(11); // false IDBKeyRange.lowerBound(12).includes(12); // true IDBKeyRange.lowerBound(12).includes(13); // true // open bound (exclusive) IDBKeyRange.lowerBound(12, true).includes(11); // false IDBKeyRange.lowerBound(12, true).includes(12); // false IDBKeyRange.lowerBound(12, true).includes(13); // true // only IDBKeyRange.only(12).includes(12); // true IDBKeyRange.only(12).includes(11); // false
The text was updated successfully, but these errors were encountered:
fc93eb4
No branches or pull requests
Pretty straightforward. A polyfill would be like:
And some sample cases:
The text was updated successfully, but these errors were encountered: