MCPcopy Index your code
hub / github.com/simstudioai/sim / normalizeHeaders

Function normalizeHeaders

apps/sim/tools/file/parser.ts:38–50  ·  view source on GitHub ↗
(headers: FileParserInput['headers'])

Source from the content-addressed store, hash-verified

36 typeof value.binary === 'boolean'
37
38const normalizeHeaders = (headers: FileParserInput['headers']): Record<string, string> => {
39 const transformed = transformTable(headers ?? null)
40 return Object.entries(transformed).reduce(
41 (acc, [key, value]) => {
42 const headerName = key.trim()
43 if (headerName && value !== undefined && value !== null) {
44 acc[headerName] = String(value)
45 }
46 return acc
47 },
48 {} as Record<string, string>
49 )
50}
51
52const normalizeFileParseResult = (value: unknown): FileParseResult => {
53 if (isRecord(value) && isFileParseResult(value.output)) {

Callers 1

parser.tsFile · 0.85

Calls 1

transformTableFunction · 0.90

Tested by

no test coverage detected