htmx icon indicating copy to clipboard operation
htmx copied to clipboard

Inconsistency with `indexOf`

Open KTibow opened this issue 1 year ago • 1 comments

htmx does operations with strings throughout it. However, it's not very consistent.

Since htmx has to work in IE11, it can't use .startsWith, so it has a startsWith function. However, there are a couple odd things:

  • the logic isn't as simple as str.indexOf(prefix) === 0, instead it does some more logic with substring
  • in some places, str.indexOf(prefix) === 0 is used instead of calling startsWith

KTibow avatar Dec 28 '23 18:12 KTibow

image

From the main page. 🙂

andryyy avatar Dec 28 '23 18:12 andryyy