2 * @typedef drawBorder~parts
3 * @property {string} left
4 * @property {string} right
5 * @property {string} body
6 * @property {string} join
10 * @param {number[]} columnSizeIndex
11 * @param {drawBorder~parts} parts
14 const drawBorder = (columnSizeIndex, parts) => {
15 const columns = columnSizeIndex
17 return parts.body.repeat(size);
21 return parts.left + columns + parts.right + '\n';
25 * @typedef drawBorderTop~parts
26 * @property {string} topLeft
27 * @property {string} topRight
28 * @property {string} topBody
29 * @property {string} topJoin
33 * @param {number[]} columnSizeIndex
34 * @param {drawBorderTop~parts} parts
37 const drawBorderTop = (columnSizeIndex, parts) => {
38 const border = drawBorder(columnSizeIndex, {
42 right: parts.topRight,
45 if (border === '\n') {
53 * @typedef drawBorderJoin~parts
54 * @property {string} joinLeft
55 * @property {string} joinRight
56 * @property {string} joinBody
57 * @property {string} joinJoin
61 * @param {number[]} columnSizeIndex
62 * @param {drawBorderJoin~parts} parts
65 const drawBorderJoin = (columnSizeIndex, parts) => {
66 return drawBorder(columnSizeIndex, {
70 right: parts.joinRight,
75 * @typedef drawBorderBottom~parts
76 * @property {string} topLeft
77 * @property {string} topRight
78 * @property {string} topBody
79 * @property {string} topJoin
83 * @param {number[]} columnSizeIndex
84 * @param {drawBorderBottom~parts} parts
87 const drawBorderBottom = (columnSizeIndex, parts) => {
88 return drawBorder(columnSizeIndex, {
89 body: parts.bottomBody,
90 join: parts.bottomJoin,
91 left: parts.bottomLeft,
92 right: parts.bottomRight,