(result: any, fn: (item:any)=> any)
| 26 | |
| 27 | |
| 28 | async function applyFunctionToResult(result: any, fn: (item:any)=> any) { |
| 29 | if (Array.isArray(result)) { |
| 30 | for (const item of result) { |
| 31 | await fn(item); |
| 32 | } |
| 33 | } else if (result != null && typeof result === 'object' && Symbol.iterator in result) { |
| 34 | for (const item of result) { |
| 35 | await fn(item); |
| 36 | } |
| 37 | } else { |
| 38 | return fn(result); |
| 39 | } |
| 40 | } |
| 41 | function createCsvItemWriterFn(streamFn: any, writer: any) { |
| 42 | let isPreStartCalled = false; |
| 43 |
no outgoing calls
no test coverage detected