MCPcopy Index your code
hub / github.com/massCodeIO/massCode / normalizeHttpMethod

Function normalizeHttpMethod

src/main/http/import/normalize.ts:77–90  ·  view source on GitHub ↗
(
  value: unknown,
  source: string,
  warnings: HttpImportWarning[],
)

Source from the content-addressed store, hash-verified

75}
76
77export function normalizeHttpMethod(
78 value: unknown,
79 source: string,
80 warnings: HttpImportWarning[],
81): HttpMethod | null {
82 const method = typeof value === 'string' ? value.toUpperCase() : 'GET'
83
84 if (SUPPORTED_METHODS.has(method as HttpMethod)) {
85 return method as HttpMethod
86 }
87
88 addWarning(warnings, source, `Unsupported HTTP method "${method}" skipped`)
89 return null
90}
91
92function decodeQueryPart(value: string): string {
93 try {

Callers 3

parseOperationFunction · 0.90
parseRequestFunction · 0.90
parseRequestFunction · 0.90

Calls 1

addWarningFunction · 0.70

Tested by

no test coverage detected