symbols.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. 'use strict';
  2. const isHyper = typeof process !== 'undefined' && process.env.TERM_PROGRAM === 'Hyper';
  3. const isWindows = typeof process !== 'undefined' && process.platform === 'win32';
  4. const isLinux = typeof process !== 'undefined' && 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. question: '?',
  28. section: '§',
  29. starsOff: '☆',
  30. starsOn: '★',
  31. upDownArrow: '↕'
  32. };
  33. const windows = Object.assign({}, common, {
  34. check: '√',
  35. cross: '×',
  36. ellipsisLarge: '...',
  37. ellipsis: '...',
  38. info: 'i',
  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. questionFull: '?',
  54. questionSmall: '﹖',
  55. pointer: isLinux ? '▸' : '❯',
  56. pointerSmall: isLinux ? '‣' : '›',
  57. radioOff: '◯',
  58. radioOn: '◉',
  59. warning: '⚠'
  60. });
  61. module.exports = (isWindows && !isHyper) ? windows : other;
  62. Reflect.defineProperty(module.exports, 'common', { enumerable: false, value: common });
  63. Reflect.defineProperty(module.exports, 'windows', { enumerable: false, value: windows });
  64. Reflect.defineProperty(module.exports, 'other', { enumerable: false, value: other });