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