-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Fix usage of String#includes which is es6 but not transformed by buble #8565
Conversation
src/util/mapbox.js
Outdated
@@ -178,7 +178,7 @@ export class RequestManager { | |||
if (accessToken[0] === 's') | |||
throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${help}`); | |||
|
|||
urlObject.params = urlObject.params.filter((d) => !d.includes('access_token')); | |||
urlObject.params = urlObject.params.filter((d) => d.indexOf('access_token') !== -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Invert the comparison — "not includes" will translate to indexOf(...) === -1
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Vlad. Classic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 pending rebase after newlines fix (or fixing it in this PR because it's not a big deal)
* origin/publisher-production: update version to v1.2.0 (#8562) Fix usage of String.includes which is es6 but not transformed by buble (#8565) (#8573) [docs] fix missing location prop to feedback component (#8554) Fix typo [docs] update dr-ui (#8548) [docs] fix errors on IE11 caused by dr-ui dependencies (#8544) updates directions plugin version (#8536) add dds sdk support squash (#8529) [docs] adds feedback component (#8507)
Fix a usage of
String#includes
which breaks in any non-es6 browser and is also not handled by buble transformation.