Remova as barras do javascript de corda
str = str.replace(/\\/g, '')
feddynventor
str = str.replace(/\\/g, '')
let path = "/some/string/with-trailing-slash/"
path = path.replace(/\/$/, "") // /some/string/with-a-slash
// * * *
let path = "/some/string/without-a-trailing-slash"
path = path.replace(/\/$/, "") // /some/string/without-a-trailing-slash
string.replace(/\/$/, "")