123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- "use strict";
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.drawBorderTop = exports.drawBorderJoin = exports.drawBorderBottom = exports.drawBorder = void 0;
-
- /**
- * @typedef drawBorder~parts
- * @property {string} left
- * @property {string} right
- * @property {string} body
- * @property {string} join
- */
-
- /**
- * @param {number[]} columnSizeIndex
- * @param {drawBorder~parts} parts
- * @returns {string}
- */
- const drawBorder = (columnSizeIndex, parts) => {
- const columns = columnSizeIndex.map(size => {
- return parts.body.repeat(size);
- }).join(parts.join);
- return parts.left + columns + parts.right + '\n';
- };
- /**
- * @typedef drawBorderTop~parts
- * @property {string} topLeft
- * @property {string} topRight
- * @property {string} topBody
- * @property {string} topJoin
- */
-
- /**
- * @param {number[]} columnSizeIndex
- * @param {drawBorderTop~parts} parts
- * @returns {string}
- */
-
-
- exports.drawBorder = drawBorder;
-
- const drawBorderTop = (columnSizeIndex, parts) => {
- return drawBorder(columnSizeIndex, {
- body: parts.topBody,
- join: parts.topJoin,
- left: parts.topLeft,
- right: parts.topRight
- });
- };
- /**
- * @typedef drawBorderJoin~parts
- * @property {string} joinLeft
- * @property {string} joinRight
- * @property {string} joinBody
- * @property {string} joinJoin
- */
-
- /**
- * @param {number[]} columnSizeIndex
- * @param {drawBorderJoin~parts} parts
- * @returns {string}
- */
-
-
- exports.drawBorderTop = drawBorderTop;
-
- const drawBorderJoin = (columnSizeIndex, parts) => {
- return drawBorder(columnSizeIndex, {
- body: parts.joinBody,
- join: parts.joinJoin,
- left: parts.joinLeft,
- right: parts.joinRight
- });
- };
- /**
- * @typedef drawBorderBottom~parts
- * @property {string} topLeft
- * @property {string} topRight
- * @property {string} topBody
- * @property {string} topJoin
- */
-
- /**
- * @param {number[]} columnSizeIndex
- * @param {drawBorderBottom~parts} parts
- * @returns {string}
- */
-
-
- exports.drawBorderJoin = drawBorderJoin;
-
- const drawBorderBottom = (columnSizeIndex, parts) => {
- return drawBorder(columnSizeIndex, {
- body: parts.bottomBody,
- join: parts.bottomJoin,
- left: parts.bottomLeft,
- right: parts.bottomRight
- });
- };
-
- exports.drawBorderBottom = drawBorderBottom;
- //# sourceMappingURL=drawBorder.js.map
|