algolia / search-insights.js

Library for reporting click, conversion and view metrics using the Algolia Insights API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

startsWith causes error in IE10

emuvente opened this issue · comments

Console error in Internet Explorer 10, Windows 7, visiting https://www.kiva.org/algolia-vue
Object doesn't support property or method 'startsWith' search-insights@1.0.0, line 1 character 13668

The code at that position:
...t&&""!==t&&t.startsWith("anonymous-")?this._userTok...

We shouldn't have to use polyfills in this project. indexOf would work:

'anonymous-token'.indexOf('anonymous-') === 0
// => true

We'll make sure to update this, thanks for reporting. In the meantime, you can use the polyfill that @Haroenv mentioned.

this was fixed in #129