dataforseo-mcp-server
Version:
CLI and MCP server for DataForSEO API — browse documentation and make authenticated API requests
19 lines • 602 B
JavaScript
function applyAiSuffixToPathname(pathname) {
const withoutTrailingSlash = pathname.replace(/\/$/, "");
if (withoutTrailingSlash.endsWith(".ai")) {
return pathname;
}
return `${withoutTrailingSlash}.ai`;
}
export function applyAiModePath(path, aiMode) {
if (!aiMode) {
return path;
}
if (path.startsWith("http://") || path.startsWith("https://")) {
const url = new URL(path);
url.pathname = applyAiSuffixToPathname(url.pathname);
return url.toString();
}
return applyAiSuffixToPathname(path);
}
//# sourceMappingURL=path.js.map