Closed Ptival closed 3 years ago
Good point.
Ugh, fixing this isn't totally easy, as DOMStringList
doesn't support types for its content.
(fwiw, in Edge, it does return an array, as this property is polyfilled. However I don't know how much I care about this difference, as I intend to remove EdgeHTML support in the next major version)
I'd be interested in submitted a PR for this if @jakearchibald hasn't worked on it yet 😄.
Go for it!
I think there's still an issue with objectStoreNames
when it is accessed off a transaction: https://github.com/jakearchibald/idb/blob/abce3c7c2fe4b3cfe4e1eb77f41ffaf0c79fd073/src/entry.ts#L531
It is array like, rather than DOMStringList. Just got burnt by this in a migration where I used includes
instead of contains
😞
I'll fix this tomorrow
Fix published as 6.1.4.
Woohoo pipeline fixed, thanks!
https://github.com/jakearchibald/idb/blob/809a75ccc31c46ac62174ff9c2c10efffa5a53df/lib/entry.ts#L149
As far as I can tell, within my browser, this method returns a
DOMStringList
, which is not an array.In particular, it contains a method
contains
, and does not contain array methods such asindexOf
, which leads to both static and run-time errors.