stripEndingSlash.js 221 B

123456789
  1. // return url with last `/` removed
  2. function removeEndingForwardSlash(url) {
  3. if (url.endsWith('/')) {
  4. return url.substring(0, url.length - 1)
  5. }
  6. return url.toString()
  7. }
  8. module.exports = removeEndingForwardSlash