getBorderCharacters.js 2.3 KB

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