@trenskow/print 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/index.js +7 -1
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -92,8 +92,14 @@ const printer = (stream) => {
92
92
  });
93
93
 
94
94
  data.forEach((row, idx) => {
95
+
95
96
  print.nn(idx === 0 && header ? '\x1b[1m' : '\x1b[0m');
96
- print(row.map((cell, idx) => cell.padEnd(columnWidth[idx])).join(' '));
97
+
98
+ print(
99
+ row
100
+ .map((cell) => typeof cell === 'function' ? cell() : cell)
101
+ .map((cell, idx) => cell.padEnd(columnWidth[idx])).join(' '));
102
+
97
103
  });
98
104
 
99
105
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trenskow/print",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "A simple package for printing to the console (or other streams).",
5
5
  "main": "index.js",
6
6
  "type": "module",