(data: any)
| 303 | return readFile('temp.txt') |
| 304 | } |
| 305 | function normalizeData(data: any): any[] { |
| 306 | if (data === null || data === undefined) { |
| 307 | return [] |
| 308 | } else if (Array.isArray(data)) { |
| 309 | const normalizedList: any[] = [] |
| 310 | for (const item of data) { |
| 311 | if (item === null || item === undefined) { |
| 312 | continue |
| 313 | } else if (typeof item !== 'object' || Array.isArray(item)) { |
| 314 | normalizedList.push({ data: item }) |
| 315 | } else { |
| 316 | normalizedList.push(item) |
| 317 | } |
| 318 | } |
| 319 | return normalizedList |
| 320 | } else if (typeof data === 'object') { |
| 321 | return [data] |
| 322 | } else { |
| 323 | return [{ data }] |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | function normalizeItem(fieldnames: string[], item: any) { |
| 328 | const filteredItem: { [key: string]: any} = {} |
no test coverage detected