MCPcopy Create free account
hub / github.com/omkarcloud/botasaurus / cleanBasePath

Function cleanBasePath

js/botasaurus-desktop-api/src/index.ts:72–92  ·  view source on GitHub ↗
(apiBasePath: string | null | undefined)

Source from the content-addressed store, hash-verified

70 .replace(/\/+/g, "/");
71}
72function cleanBasePath(apiBasePath: string | null | undefined){
73
74 if (typeof apiBasePath === "string") {
75 let path = apiBasePath ? normalizePath(apiBasePath) : "";
76
77 if (path === ".") {
78 path = "";
79 } else if (path) {
80 if (!path.startsWith("/")) {
81 path = "/" + path;
82 }
83 if (path.endsWith("/")) {
84 path = path.slice(0, -1);
85 }
86 }
87
88 return path;
89 }
90 return ''
91
92}
93/**
94 * Configuration options for the Api client
95 */

Callers 1

constructorMethod · 0.70

Calls 1

normalizePathFunction · 0.70

Tested by

no test coverage detected