MCPcopy Create free account
hub / github.com/avoidwork/tenso / hasBody

Function hasBody

src/utils/hasBody.js:8–20  ·  view source on GitHub ↗
(arg)

Source from the content-addressed store, hash-verified

6 * @returns {boolean} True if the method can have a body (PATCH, POST, PUT), false otherwise
7 */
8export function hasBody (arg) {
9 const trimmed = arg.trim().toUpperCase();
10
11 // Check for exact matches first
12 if (trimmed === PATCH || trimmed === POST || trimmed === PUT) {
13 return true;
14 }
15
16 // For comma-delimited strings, split and check each method
17 const methods = trimmed.split(",").map(method => method.trim());
18
19 return methods.some(method => method === PATCH || method === POST || method === PUT);
20}

Callers 3

canModifyMethod · 0.90
payloadFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected