Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | 40x 40x 40x 768x 14x 768x 768x 3x 3x 2x 3x 4x 4x 4x 4x 4x 4x 4x 4x 2x 768x 768x 7x 7x 2x 2x 2x 2x 2x 2x 2x 768x 40x | 'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
module.exports = () => ({
prepareOutput(rows, { details }) {
return details ? rows : rows.map(({ commodity }) => commodity);
},
formatCsv(rows, { details }, { csvField }) {
if (!details)
return `${['commodity', ...rows.map(csvField)].join('\n')}\n`;
const lines = ['commodity,comment,format,isDefault,used'];
for (const row of rows) {
lines.push([
row.commodity,
row.comment ?? '',
row.format ?? '',
row.isDefault,
row.used,
].map(csvField).join(','));
}
return `${lines.join('\n')}\n`;
},
formatText(rows, { details }, { formatTextTable }) {
if (!details)
return rows.length === 0 ? '' : `${rows.join('\n')}\n`;
return formatTextTable(rows, [
{ heading: 'Commodity', value: (row) => row.commodity },
{ heading: 'Default', value: (row) => row.isDefault ? 'yes' : '' },
{ heading: 'Used', value: (row) => row.used ? 'yes' : '' },
{ heading: 'Format', value: (row) => row.format ?? '' },
{ heading: 'Comment', value: (row) => row.comment ?? '' },
]);
},
});
|