2 Object.defineProperty(exports, "__esModule", { value: true });
3 exports.drawContent = void 0;
5 * Shared function to draw horizontal borders, rows or the entire table
7 const drawContent = (contents, separatorConfig) => {
8 const { separatorGetter, drawSeparator } = separatorConfig;
9 const contentSize = contents.length;
11 if (drawSeparator(0, contentSize)) {
12 result.push(separatorGetter(0, contentSize));
14 contents.forEach((content, contentIndex) => {
16 // Only append the middle separator if the content is not the last
17 if (contentIndex + 1 < contentSize && drawSeparator(contentIndex + 1, contentSize)) {
18 result.push(separatorGetter(contentIndex + 1, contentSize));
21 if (drawSeparator(contentSize, contentSize)) {
22 result.push(separatorGetter(contentSize, contentSize));
24 return result.join('');
26 exports.drawContent = drawContent;
27 //# sourceMappingURL=drawContent.js.map