UTFSequence.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @flow strict-local
  8. * @format
  9. */
  10. 'use strict';
  11. const deepFreezeAndThrowOnMutationInDev = require('./Utilities/deepFreezeAndThrowOnMutationInDev');
  12. /**
  13. * A collection of Unicode sequences for various characters and emoji.
  14. *
  15. * - More explicit than using the sequences directly in code.
  16. * - Source code should be limitted to ASCII.
  17. * - Less chance of typos.
  18. */
  19. const UTFSequence: {|
  20. BOM: string,
  21. BULLET: string,
  22. BULLET_SP: string,
  23. MDASH: string,
  24. MDASH_SP: string,
  25. MIDDOT: string,
  26. MIDDOT_KATAKANA: string,
  27. MIDDOT_SP: string,
  28. NBSP: string,
  29. NDASH: string,
  30. NDASH_SP: string,
  31. PIZZA: string,
  32. TRIANGLE_LEFT: string,
  33. TRIANGLE_RIGHT: string,
  34. |} = deepFreezeAndThrowOnMutationInDev({
  35. BOM: '\ufeff', // byte order mark
  36. BULLET: '\u2022', // bullet: •
  37. BULLET_SP: '\u00A0\u2022\u00A0', //  • 
  38. MIDDOT: '\u00B7', // normal middle dot: ·
  39. MIDDOT_SP: '\u00A0\u00B7\u00A0', //  · 
  40. MIDDOT_KATAKANA: '\u30FB', // katakana middle dot
  41. MDASH: '\u2014', // em dash: —
  42. MDASH_SP: '\u00A0\u2014\u00A0', //  — 
  43. NDASH: '\u2013', // en dash: –
  44. NDASH_SP: '\u00A0\u2013\u00A0', //  – 
  45. NBSP: '\u00A0', // non-breaking space:  
  46. PIZZA: '\uD83C\uDF55',
  47. TRIANGLE_LEFT: '\u25c0', // black left-pointing triangle
  48. TRIANGLE_RIGHT: '\u25b6', // black right-pointing triangle
  49. });
  50. module.exports = UTFSequence;