MCPcopy Create free account
hub / github.com/bahmutov/console.table / arrayToString

Function arrayToString

index.js:31–46  ·  view source on GitHub ↗
(arr)

Source from the content-addressed store, hash-verified

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();

Callers 5

printTitleTableFunction · 0.85
getTitleTableFunction · 0.85
objectToStringFunction · 0.85
consoleTableFunction · 0.85
setupConsoleTableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…