suggestion to use str.indexOf(searchString) === 0 for better compatibility
elasim opened this issue · comments
According to caniuse, the browser coverage for the fetch API is similar to the support range for String.prototype.startsWith,
which suggests that browsers requiring a fetch polyfill would likely also need a polyfill for the startsWith API.
Therefore, it would be advisable to use str.indexOf(searchString) === 0 instead of startsWith in the code for better compatibility across browsers
![image](https://private-user-images.githubusercontent.com/1837682/281408545-35662b80-2822-4fcc-9360-a468a3fcb848.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU5NDI4NjMsIm5iZiI6MTcxNTk0MjU2MywicGF0aCI6Ii8xODM3NjgyLzI4MTQwODU0NS0zNTY2MmI4MC0yODIyLTRmY2MtOTM2MC1hNDY4YTNmY2I4NDgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDUxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA1MTdUMTA0MjQzWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjQ1ODQwMmEzYTA3MWIxODY5NTE2MzkzODNkOGQ1MTdkMGY0MTZiNzcwN2RmMzhhYWE5NTRkNDdlZjIxZmI2ZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.O0RnnbhQutgWFPrFbpj-JzHmiinEkvLhyAhrKGP4ihQ)
Lines 544 to 550 in b5cee50
I'll happily accept a pull request if you are up for submitting one
@elasim Good point 👍