Note: already implemented under a general IndexedDBExperimental flag. This is really just an I2S but no specific I2I was sent for this one method.
Contact emails
Spec
https://w3c.github.io/IndexedDB/#dom-idbkeyrange-includes
Summary
An IDBKeyRange represents what you'd call an interval in mathematics - a set of possible keys ranging from an optional lower bound to an optional upper bound and the bounds can be open (exclusive) or closed (inclusive). These are used for queries, e.g. store.getAll(IDBKeyRange.bound(1, 10))
The change adds an instance method, keyRange.includes(key) that tells you whether or not the key is present in the range. The name follows from the ECMAScript Array.prototype.includes and String.prototype.includes methods.
Motivation
Testing whether a key exists in a range requires comparing against the bounds and accounting for open/closed bounds. Straightforward and polyfillable, but annoying when needed as a primitive for building on top of IDB.
Interoperability and Compatibility Risk
Implemented and shipping in Firefox 47.
W3C Tests: https://github.com/w3c/web-platform-tests/blob/master/IndexedDB/idbkeyrange-includes.htm
MDN documentation: https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/includes
(includes a polyfill)
Ongoing technical constraints
None.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
OWP launch tracking bug
Link to entry on the feature dashboard
https://www.chromestatus.com/feature/6571252802125824Requesting approval to ship?
Yes.
lgtm3