UNPKG

5.55 kBJavaScriptView Raw
1/**
2 * A record of a white space character.
3 *
4 * @typedef {object} CharRecord
5 * @property {number} code - The character code.
6 * @property {string} description - A description of the character.
7 * @property {boolean} es5 - Whether the spec lists this as a white space.
8 * @property {boolean} es2015 - Whether the spec lists this as a white space.
9 * @property {boolean} es2016 - Whether the spec lists this as a white space.
10 * @property {boolean} es2017 - Whether the spec lists this as a white space.
11 * @property {boolean} es2018 - Whether the spec lists this as a white space.
12 * @property {string} string - The character string.
13 */
14
15/**
16 * An array of the whitespace char codes, string, descriptions and language
17 * presence in the specifications.
18 *
19 * @type Array.<CharRecord>
20 */
21export var list = [{
22 code: 0x0009,
23 description: 'Tab',
24 es5: true,
25 es2015: true,
26 es2016: true,
27 es2017: true,
28 es2018: true,
29 string: "\t"
30}, {
31 code: 0x000a,
32 description: 'Line Feed',
33 es5: true,
34 es2015: true,
35 es2016: true,
36 es2017: true,
37 es2018: true,
38 string: "\n"
39}, {
40 code: 0x000b,
41 description: 'Vertical Tab',
42 es5: true,
43 es2015: true,
44 es2016: true,
45 es2017: true,
46 es2018: true,
47 string: "\x0B"
48}, {
49 code: 0x000c,
50 description: 'Form Feed',
51 es5: true,
52 es2015: true,
53 es2016: true,
54 es2017: true,
55 es2018: true,
56 string: "\f"
57}, {
58 code: 0x000d,
59 description: 'Carriage Return',
60 es5: true,
61 es2015: true,
62 es2016: true,
63 es2017: true,
64 es2018: true,
65 string: "\r"
66}, {
67 code: 0x0020,
68 description: 'Space',
69 es5: true,
70 es2015: true,
71 es2016: true,
72 es2017: true,
73 es2018: true,
74 string: " "
75},
76/*
77{
78 code: 0x0085,
79 description: 'Next line',
80 es5: false,
81 es2015: false,
82 es2016: false,
83 es2017: false,
84 es2018: false,
85 string: '\u0085'
86}
87*/
88{
89 code: 0x00a0,
90 description: 'No-break space',
91 es5: true,
92 es2015: true,
93 es2016: true,
94 es2017: true,
95 es2018: true,
96 string: "\xA0"
97}, {
98 code: 0x1680,
99 description: 'Ogham space mark',
100 es5: true,
101 es2015: true,
102 es2016: true,
103 es2017: true,
104 es2018: true,
105 string: "\u1680"
106}, {
107 code: 0x180e,
108 description: 'Mongolian vowel separator',
109 es5: true,
110 es2015: true,
111 es2016: true,
112 es2017: false,
113 es2018: false,
114 string: "\u180E"
115}, {
116 code: 0x2000,
117 description: 'En quad',
118 es5: true,
119 es2015: true,
120 es2016: true,
121 es2017: true,
122 es2018: true,
123 string: "\u2000"
124}, {
125 code: 0x2001,
126 description: 'Em quad',
127 es5: true,
128 es2015: true,
129 es2016: true,
130 es2017: true,
131 es2018: true,
132 string: "\u2001"
133}, {
134 code: 0x2002,
135 description: 'En space',
136 es5: true,
137 es2015: true,
138 es2016: true,
139 es2017: true,
140 es2018: true,
141 string: "\u2002"
142}, {
143 code: 0x2003,
144 description: 'Em space',
145 es5: true,
146 es2015: true,
147 es2016: true,
148 es2017: true,
149 es2018: true,
150 string: "\u2003"
151}, {
152 code: 0x2004,
153 description: 'Three-per-em space',
154 es5: true,
155 es2015: true,
156 es2016: true,
157 es2017: true,
158 es2018: true,
159 string: "\u2004"
160}, {
161 code: 0x2005,
162 description: 'Four-per-em space',
163 es5: true,
164 es2015: true,
165 es2016: true,
166 es2017: true,
167 es2018: true,
168 string: "\u2005"
169}, {
170 code: 0x2006,
171 description: 'Six-per-em space',
172 es5: true,
173 es2015: true,
174 es2016: true,
175 es2017: true,
176 es2018: true,
177 string: "\u2006"
178}, {
179 code: 0x2007,
180 description: 'Figure space',
181 es5: true,
182 es2015: true,
183 es2016: true,
184 es2017: true,
185 es2018: true,
186 string: "\u2007"
187}, {
188 code: 0x2008,
189 description: 'Punctuation space',
190 es5: true,
191 es2015: true,
192 es2016: true,
193 es2017: true,
194 es2018: true,
195 string: "\u2008"
196}, {
197 code: 0x2009,
198 description: 'Thin space',
199 es5: true,
200 es2015: true,
201 es2016: true,
202 es2017: true,
203 es2018: true,
204 string: "\u2009"
205}, {
206 code: 0x200a,
207 description: 'Hair space',
208 es5: true,
209 es2015: true,
210 es2016: true,
211 es2017: true,
212 es2018: true,
213 string: "\u200A"
214},
215/*
216{
217 code: 0x200b,
218 description: 'Zero width space',
219 es5: false,
220 es2015: false,
221 es2016: false,
222 es2017: false,
223 es2018: false,
224 string: '\u200b'
225},
226*/
227{
228 code: 0x2028,
229 description: 'Line separator',
230 es5: true,
231 es2015: true,
232 es2016: true,
233 es2017: true,
234 es2018: true,
235 string: "\u2028"
236}, {
237 code: 0x2029,
238 description: 'Paragraph separator',
239 es5: true,
240 es2015: true,
241 es2016: true,
242 es2017: true,
243 es2018: true,
244 string: "\u2029"
245}, {
246 code: 0x202f,
247 description: 'Narrow no-break space',
248 es5: true,
249 es2015: true,
250 es2016: true,
251 es2017: true,
252 es2018: true,
253 string: "\u202F"
254}, {
255 code: 0x205f,
256 description: 'Medium mathematical space',
257 es5: true,
258 es2015: true,
259 es2016: true,
260 es2017: true,
261 es2018: true,
262 string: "\u205F"
263}, {
264 code: 0x3000,
265 description: 'Ideographic space',
266 es5: true,
267 es2015: true,
268 es2016: true,
269 es2017: true,
270 es2018: true,
271 string: "\u3000"
272}, {
273 code: 0xfeff,
274 description: 'Byte Order Mark',
275 es5: true,
276 es2015: true,
277 es2016: true,
278 es2017: true,
279 es2018: true,
280 string: "\uFEFF"
281}];
282/**
283 * A string of the ES5 to ES2016 whitespace characters.
284 *
285 * @type string
286 */
287
288var stringES2016 = '';
289/**
290 * A string of the ES2017 to ES2018 whitespace characters.
291 *
292 * @type string
293 */
294
295var stringES2018 = '';
296var length = list.length;
297
298for (var i = 0; i < length; i += 1) {
299 if (list[i].es2016) {
300 stringES2016 += list[i].string;
301 }
302
303 if (list[i].es2018) {
304 stringES2018 += list[i].string;
305 }
306}
307
308var string2018 = stringES2018;
309export default string2018;
310export var string2016 = stringES2016;
311
312//# sourceMappingURL=white-space-x.esm.js.map
\No newline at end of file