@patruff/server-curl
Version:
MCP server for making curl/HTTP requests to fetch resources from the internet, with optional image conversion
12 lines (11 loc) • 623 B
JavaScript
export function isValidCurlArgs(args) {
return (typeof args === "object" &&
args !== null &&
typeof args.url === "string" &&
(args.method === undefined || typeof args.method === "string") &&
(args.headers === undefined || (typeof args.headers === "object" && args.headers !== null)) &&
(args.body === undefined || typeof args.body === "string") &&
(args.timeout === undefined || typeof args.timeout === "number") &&
(args.convertTo === undefined || typeof args.convertTo === "string") &&
(args.saveAs === undefined || typeof args.saveAs === "string"));
}