(arr)
| 29 | var Table = require('easy-table'); |
| 30 | |
| 31 | function arrayToString(arr) { |
| 32 | var t = new Table(); |
| 33 | arr.forEach(function (record) { |
| 34 | if (typeof record === 'string' || |
| 35 | typeof record === 'number') { |
| 36 | t.cell('item', record); |
| 37 | } else { |
| 38 | // assume plain object |
| 39 | Object.keys(record).forEach(function (property) { |
| 40 | t.cell(property, record[property]); |
| 41 | }); |
| 42 | } |
| 43 | t.newRow(); |
| 44 | }); |
| 45 | return t.toString(); |
| 46 | } |
| 47 | |
| 48 | function printTableWithColumnTitles(titles, items,noConsole) { |
| 49 | var t = new Table(); |
no outgoing calls
no test coverage detected
searching dependent graphs…