dataforseo-mcp-server
Version:
CLI and MCP server for DataForSEO API — browse documentation and make authenticated API requests
18 lines • 571 B
JavaScript
/**
* Shared Live-endpoint helpers used by api-request and docs middleware.
*/
export function isLiveEndpoint(pathOrUrl) {
return /(?:^|\/)live(?:\/|\.ai|$)/i.test(extractPathname(pathOrUrl));
}
function extractPathname(pathOrUrl) {
if (pathOrUrl.startsWith("http://") || pathOrUrl.startsWith("https://")) {
try {
return new URL(pathOrUrl).pathname;
}
catch {
return pathOrUrl.split("?")[0] ?? pathOrUrl;
}
}
return pathOrUrl.split("?")[0] ?? pathOrUrl;
}
//# sourceMappingURL=live-endpoint.js.map