You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
2.2 KiB

4 years ago
  1. /* eslint-disable sort-keys */
  2. /**
  3. * @typedef border
  4. * @property {string} topBody
  5. * @property {string} topJoin
  6. * @property {string} topLeft
  7. * @property {string} topRight
  8. * @property {string} bottomBody
  9. * @property {string} bottomJoin
  10. * @property {string} bottomLeft
  11. * @property {string} bottomRight
  12. * @property {string} bodyLeft
  13. * @property {string} bodyRight
  14. * @property {string} bodyJoin
  15. * @property {string} joinBody
  16. * @property {string} joinLeft
  17. * @property {string} joinRight
  18. * @property {string} joinJoin
  19. */
  20. /**
  21. * @param {string} name
  22. * @returns {border}
  23. */
  24. export default (name) => {
  25. if (name === 'honeywell') {
  26. return {
  27. topBody: '═',
  28. topJoin: '╤',
  29. topLeft: '╔',
  30. topRight: '╗',
  31. bottomBody: '═',
  32. bottomJoin: '╧',
  33. bottomLeft: '╚',
  34. bottomRight: '╝',
  35. bodyLeft: '║',
  36. bodyRight: '║',
  37. bodyJoin: '│',
  38. joinBody: '─',
  39. joinLeft: '╟',
  40. joinRight: '╢',
  41. joinJoin: '┼'
  42. };
  43. }
  44. if (name === 'norc') {
  45. return {
  46. topBody: '─',
  47. topJoin: '┬',
  48. topLeft: '┌',
  49. topRight: '┐',
  50. bottomBody: '─',
  51. bottomJoin: '┴',
  52. bottomLeft: '└',
  53. bottomRight: '┘',
  54. bodyLeft: '│',
  55. bodyRight: '│',
  56. bodyJoin: '│',
  57. joinBody: '─',
  58. joinLeft: '├',
  59. joinRight: '┤',
  60. joinJoin: '┼'
  61. };
  62. }
  63. if (name === 'ramac') {
  64. return {
  65. topBody: '-',
  66. topJoin: '+',
  67. topLeft: '+',
  68. topRight: '+',
  69. bottomBody: '-',
  70. bottomJoin: '+',
  71. bottomLeft: '+',
  72. bottomRight: '+',
  73. bodyLeft: '|',
  74. bodyRight: '|',
  75. bodyJoin: '|',
  76. joinBody: '-',
  77. joinLeft: '|',
  78. joinRight: '|',
  79. joinJoin: '|'
  80. };
  81. }
  82. if (name === 'void') {
  83. return {
  84. topBody: '',
  85. topJoin: '',
  86. topLeft: '',
  87. topRight: '',
  88. bottomBody: '',
  89. bottomJoin: '',
  90. bottomLeft: '',
  91. bottomRight: '',
  92. bodyLeft: '',
  93. bodyRight: '',
  94. bodyJoin: '',
  95. joinBody: '',
  96. joinLeft: '',
  97. joinRight: '',
  98. joinJoin: ''
  99. };
  100. }
  101. throw new Error('Unknown border template "' + name + '".');
  102. };