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

Function normalizeEntries

src/main/http/import/normalize.ts:135–157  ·  view source on GitHub ↗
(
  entries: T[],
  source: string,
  warnings: HttpImportWarning[],
)

Source from the content-addressed store, hash-verified

133}
134
135export function normalizeEntries<T extends HttpHeaderEntry | HttpQueryEntry>(
136 entries: T[],
137 source: string,
138 warnings: HttpImportWarning[],
139): T[] {
140 const result: T[] = []
141
142 for (const entry of entries) {
143 const key = entry.key.trim()
144 const value = entry.value ?? ''
145
146 if (!key) {
147 if (value) {
148 addWarning(warnings, source, 'Skipped entry with empty key')
149 }
150 continue
151 }
152
153 result.push({ ...entry, key, value })
154 }
155
156 return result
157}
158
159export function resolveAuthConflict(
160 headers: HttpHeaderEntry[],

Callers 3

parseOperationFunction · 0.90
parseRequestFunction · 0.90
parseRequestFunction · 0.90

Calls 1

addWarningFunction · 0.70

Tested by

no test coverage detected