style: clean up trimSlash
style: clean up trimSlash

This code violates the ESLint unicorn/prefer-negative-index rule.  Clean
it up and simplify a bit.

Signed-off-by: Kevin Locke <ffb4761cba839470133bee36aeb139f58d7dbaa9@kevinlocke.name>

kevinoid/travis-status,kevinoid/travis-status,kevinoid/travis-status