symbols.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. 'use strict';
  2. const isHyper = process.env.TERM_PROGRAM === 'Hyper';
  3. const isWindows = process.platform === 'win32';
  4. const isLinux = process.platform === 'linux';
  5. const common = {
  6. ballotDisabled: '☒',
  7. ballotOff: '☐',
  8. ballotOn: '☑',
  9. bullet: '•',
  10. bulletWhite: '◦',
  11. fullBlock: '█',
  12. heart: '❤',
  13. identicalTo: '≡',
  14. line: '─',
  15. mark: '※',
  16. middot: '·',
  17. minus: '-',
  18. multiplication: '×',
  19. obelus: '÷',
  20. pencilDownRight: '✎',
  21. pencilRight: '✏',
  22. pencilUpRight: '✐',
  23. percent: '%',
  24. pilcrow2: '❡',
  25. pilcrow: '¶',
  26. plusMinus: '±',
  27. section: '§',
  28. starsOff: '☆',
  29. starsOn: '★',
  30. upDownArrow: '↕'
  31. };
  32. const windows = Object.assign({}, common, {
  33. check: '√',
  34. cross: '×',
  35. ellipsisLarge: '...',
  36. ellipsis: '...',
  37. info: 'i',
  38. question: '?',
  39. questionSmall: '?',
  40. pointer: '>',
  41. pointerSmall: '»',
  42. radioOff: '( )',
  43. radioOn: '(*)',
  44. warning: '‼'
  45. });
  46. const other = Object.assign({}, common, {
  47. ballotCross: '✘',
  48. check: '✔',
  49. cross: '✖',
  50. ellipsisLarge: '⋯',
  51. ellipsis: '…',
  52. info: 'ℹ',
  53. question: '?',
  54. questionFull: '?',
  55. questionSmall: '﹖',
  56. pointer: isLinux ? '▸' : '❯',
  57. pointerSmall: isLinux ? '‣' : '›',
  58. radioOff: '◯',
  59. radioOn: '◉',
  60. warning: '⚠'
  61. });
  62. module.exports = (isWindows && !isHyper) ? windows : other;
  63. Reflect.defineProperty(module.exports, 'common', { enumerable: false, value: common });
  64. Reflect.defineProperty(module.exports, 'windows', { enumerable: false, value: windows });
  65. Reflect.defineProperty(module.exports, 'other', { enumerable: false, value: other });