MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / trimSlash

Function trimSlash

src/utils/Url.js:329–335  ·  view source on GitHub ↗

* Removes trailing slash from url * @param {string} url * @returns

(url)

Source from the content-addressed store, hash-verified

327 * @returns
328 */
329 trimSlash(url) {
330 const parsed = this.parse(url);
331 if (parsed.url.endsWith("/")) {
332 parsed.url = parsed.url.slice(0, -1);
333 }
334 return this.join(parsed.url, parsed.query);
335 },
336 PROTOCOL_PATTERN: /^[a-z]+:\/\/\/?/i,
337};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected