Skip to content

Commit

Permalink
simplify function 'removeTrailingSlash'
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiNyzhnyk committed Jun 9, 2022
1 parent 5c170b1 commit 3106505
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/utilities.js
Expand Up @@ -438,11 +438,7 @@ utilities.replaceInPath = function(path, applyTo, options) {
* @return {string}
*/
utilities.removeTrailingSlash = function(str) {
if (str.endsWith('/')) {
return str.slice(0, -1);
}

return str;
return str.endsWith('/') ? str.slice(0, -1) : str;
};

/**
Expand Down

0 comments on commit 3106505

Please sign in to comment.