Use local module for removing trailing slash to reduce duplication

This commit is contained in:
James M. Greene
2022-08-18 17:54:00 -05:00
parent dc5b850bfd
commit 3a90973fd3
3 changed files with 7 additions and 13 deletions

View File

@@ -0,0 +1,3 @@
module.exports = function removeTrailingSlash(str) {
return str.endsWith('/') ? str.slice(0, -1) : str
}