You sure on the 'indexOf's?
indexOf returns the index placement, otherwise -1. I think it's more readable to use includes, which returns a boolean, and then ! if needed. The two functions should otherwise be almost identical (aside from includes checking if a regex is passed).
It'd certainly be easier, that's for sure.
merged
mentioned in commit 540ee8dd