Lund-Org/cherry

View on GitHub
src/helpers/format.js

Summary

Maintainability
A
0 mins
Test Coverage
module.exports = {
  /**
   * Add a slash at the end of the url if it's not already there
   * @param {string} url An url
   * @return {string}
   */
  refineUrl (url) {
    if (!url.endsWith('/')) {
      url += '/'
    }

    return url
  }
}