Skip to content

Commit 54870e0

Browse files
sahrensfacebook-github-bot
authored andcommitted
Add UTFSequence module for common unicode usage
Summary: A collection of Unicode sequences for various characters and emoji. - More explicit than using the sequences directly in code. - Source code should be limitted to ASCII. - Less chance of typos. Reviewed By: TheSavior Differential Revision: D6969065 fbshipit-source-id: c11ec96b74f5dfa7c624a3c53f3c29f6284a82b3
1 parent 427e464 commit 54870e0

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Libraries/UTFSequence.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* Copyright (c) 2016-present, Facebook, Inc.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree. An additional grant
7+
* of patent rights can be found in the PATENTS file in the same directory.
8+
*
9+
* @providesModule UTFSequence
10+
* @flow
11+
* @format
12+
*/
13+
14+
'use strict';
15+
16+
/**
17+
* A collection of Unicode sequences for various characters and emoji.
18+
*
19+
* - More explicit than using the sequences directly in code.
20+
* - Source code should be limitted to ASCII.
21+
* - Less chance of typos.
22+
*/
23+
const UTFSequence = {
24+
MIDDOT: '\u00B7', // normal middle dot: ·
25+
MIDDOT_SP: '\u00A0\u00B7\u00A0', //  · 
26+
MIDDOT_KATAKANA: '\u30FB', // katakana middle dot
27+
MDASH: '\u2014', // em dash: —
28+
MDASH_SP: '\u00A0\u2014\u00A0', //  — 
29+
NDASH: '\u2013', // en dash: –
30+
NDASH_SP: '\u00A0\u2013\u00A0', //  – 
31+
NBSP: '\u00A0', // non-breaking space:  
32+
PIZZA: '\uD83C\uDF55',
33+
};
34+
35+
module.exports = UTFSequence;

0 commit comments

Comments
 (0)