Polyfill for IE11 - String.prototype.includes
luish opened this issue · comments
match-sorter: 2.2.1
node: v6.11.3
npm: 5.6.0
We've been using this lib and it failed on Internet Explorer 11 because of the following line:
Line 190 in 5f2c809
Object doesn’t support property or method ‘includes’
So I'm wondering if I could contribute to this repo by adding a polyfill such as these ones:
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes#Polyfill
- https://github.com/mathiasbynens/String.prototype.includes
Thanks :)
Thanks for the issue. Rather than including a polyfill in the library, let's add a note to the README that applications using this library should include polyfills for older browsers. Small libraries like this one should not include polyfills.
Thanks for the reply, @kentcdodds.
Sounds good to me. Another alternative would be just replacing includes
with indexOf() >= 0
, and therefore the lib could be used without polyfills on the application side. What do you think?
That'd be fine with me.
🎉 This issue has been resolved in version 2.2.2 🎉
The release is available on:
npm package (@latest dist-tag)
- GitHub release
Your semantic-release bot 📦🚀