UNPKG

canonical

Version:

Canonical code style linter and formatter for JavaScript, SCSS and CSS.

21 lines (15 loc) 609 B
/* @flow */ // Matches a whole line break (where CRLF is considered a single // line break). Used to count lines. "use strict"; exports.__esModule = true; exports.isNewLine = isNewLine; var lineBreak = /\r\n?|\n|\u2028|\u2029/; exports.lineBreak = lineBreak; var lineBreakG = new RegExp(lineBreak.source, "g"); exports.lineBreakG = lineBreakG; function isNewLine(code /*: number*/) /*: boolean*/ { return code === 10 || code === 13 || code === 0x2028 || code === 0x2029; } var nonASCIIwhitespace = /[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/; exports.nonASCIIwhitespace = nonASCIIwhitespace;