UNPKG

582 BJavaScriptView Raw
1/* @flow */
2
3// Matches a whole line break (where CRLF is considered a single
4// line break). Used to count lines.
5
6"use strict";
7
8exports.__esModule = true;
9exports.isNewLine = isNewLine;
10var lineBreak = /\r\n?|\n|\u2028|\u2029/;
11exports.lineBreak = lineBreak;
12var lineBreakG = new RegExp(lineBreak.source, "g");
13
14exports.lineBreakG = lineBreakG;
15
16function isNewLine(code) {
17 return code === 10 || code === 13 || code === 0x2028 || code === 0x2029;
18}
19
20var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;
21exports.nonASCIIwhitespace = nonASCIIwhitespace;
\No newline at end of file