21 lines
804 B
JavaScript
21 lines
804 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.reportMarkdown = void 0;
|
|
const path = require("path");
|
|
const lib_1 = require("../lib/");
|
|
const csv = require('csv-stringify/lib/sync');
|
|
exports.reportMarkdown = (data) => {
|
|
const image = (path) => `)})`;
|
|
const file = (path) => `[${path}](./${(encodeURI(path))})`;
|
|
const set = data.map((d) => [
|
|
`${image(path.parse(d.target).name + path.parse(d.target).ext)}`,
|
|
`${file(path.parse(d.src).name + path.parse(d.src).ext)}`,
|
|
]);
|
|
const csvString = csv(set, {
|
|
header: true,
|
|
delimiter: ',',
|
|
columns: { 'a': 'Thumbnail', 'b': 'File' }
|
|
});
|
|
return lib_1.csvToMarkdown(csvString);
|
|
};
|
|
//# sourceMappingURL=markdown.js.map
|