Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add startsWith and endsWith for URLs. #6
I realise that this library is intended to be as small and light as possible - but I think these two assertions are essential for assertions on urls - redirects - domains etc, especially when considering the code+lab marriage.
Include goes part of the way, but checking a relative url when given an absolute url and checking schemes on domains are something I end up doing every day, hence this PR.
Hi @cjihrig - grabbed a couple of minutes to go through your suggestions. I've restricted the assertion to strings only - I toyed with arrays for a while but I couldn't think of a decent use case where you wouldn't assert more explicitly so I've gone with a string-only assertion.
Please let me know if there are any further suggestions.