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

Function cleanBasePath

js/botasaurus-server-js/src/utils.ts:101–121  ·  view source on GitHub ↗
(apiBasePath: string | null | undefined)

Source from the content-addressed store, hash-verified

99}
100
101function cleanBasePath(apiBasePath: string | null | undefined){
102
103 if (typeof apiBasePath === "string") {
104 let path = apiBasePath ? normalizePath(apiBasePath) : "";
105
106 if (path === ".") {
107 path = "";
108 } else if (path) {
109 if (!path.startsWith("/")) {
110 path = "/" + path;
111 }
112 if (path.endsWith("/")) {
113 path = path.slice(0, -1);
114 }
115 }
116
117 return path;
118 }
119 return ''
120
121}
122const negativeValues = new Set(["false", "no", "n", "0", "nah", "nope", "never", "negative", "f"]);
123const affirmativeValues = new Set(["true", "yes", "y", "1", "yeah", "yep", "sure", "ok", "okay", "affirmative", "t"]);
124

Callers 2

setApiBasePathMethod · 0.90
addScraperAliasMethod · 0.90

Calls 1

normalizePathFunction · 0.70

Tested by

no test coverage detected