UNPKG

2.45 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7
8/* eslint-disable sort-keys */
9
10/**
11 * @typedef border
12 * @property {string} topBody
13 * @property {string} topJoin
14 * @property {string} topLeft
15 * @property {string} topRight
16 * @property {string} bottomBody
17 * @property {string} bottomJoin
18 * @property {string} bottomLeft
19 * @property {string} bottomRight
20 * @property {string} bodyLeft
21 * @property {string} bodyRight
22 * @property {string} bodyJoin
23 * @property {string} joinBody
24 * @property {string} joinLeft
25 * @property {string} joinRight
26 * @property {string} joinJoin
27 */
28
29/**
30 * @param {string} name
31 * @returns {border}
32 */
33const getBorderCharacters = name => {
34 if (name === 'honeywell') {
35 return {
36 topBody: '═',
37 topJoin: '╤',
38 topLeft: '╔',
39 topRight: '╗',
40 bottomBody: '═',
41 bottomJoin: '╧',
42 bottomLeft: '╚',
43 bottomRight: '╝',
44 bodyLeft: '║',
45 bodyRight: '║',
46 bodyJoin: '│',
47 joinBody: '─',
48 joinLeft: '╟',
49 joinRight: '╢',
50 joinJoin: '┼'
51 };
52 }
53
54 if (name === 'norc') {
55 return {
56 topBody: '─',
57 topJoin: '┬',
58 topLeft: '┌',
59 topRight: '┐',
60 bottomBody: '─',
61 bottomJoin: '┴',
62 bottomLeft: '└',
63 bottomRight: '┘',
64 bodyLeft: '│',
65 bodyRight: '│',
66 bodyJoin: '│',
67 joinBody: '─',
68 joinLeft: '├',
69 joinRight: '┤',
70 joinJoin: '┼'
71 };
72 }
73
74 if (name === 'ramac') {
75 return {
76 topBody: '-',
77 topJoin: '+',
78 topLeft: '+',
79 topRight: '+',
80 bottomBody: '-',
81 bottomJoin: '+',
82 bottomLeft: '+',
83 bottomRight: '+',
84 bodyLeft: '|',
85 bodyRight: '|',
86 bodyJoin: '|',
87 joinBody: '-',
88 joinLeft: '|',
89 joinRight: '|',
90 joinJoin: '|'
91 };
92 }
93
94 if (name === 'void') {
95 return {
96 topBody: '',
97 topJoin: '',
98 topLeft: '',
99 topRight: '',
100 bottomBody: '',
101 bottomJoin: '',
102 bottomLeft: '',
103 bottomRight: '',
104 bodyLeft: '',
105 bodyRight: '',
106 bodyJoin: '',
107 joinBody: '',
108 joinLeft: '',
109 joinRight: '',
110 joinJoin: ''
111 };
112 }
113
114 throw new Error('Unknown border template "' + name + '".');
115};
116
117var _default = getBorderCharacters;
118exports.default = _default;
119//# sourceMappingURL=getBorderCharacters.js.map
\No newline at end of file