MCPcopy Create free account
hub / github.com/microsoft/typescript-go / IsWhiteSpaceSingleLine

Function IsWhiteSpaceSingleLine

internal/stringutil/util.go:16–47  ·  view source on GitHub ↗
(ch rune)

Source from the content-addressed store, hash-verified

14}
15
16func IsWhiteSpaceSingleLine(ch rune) bool {
17 // Note: nextLine is in the Zs space, and should be considered to be a whitespace.
18 // It is explicitly not a line-break as it isn't in the exact set specified by EcmaScript.
19 switch ch {
20 case
21 ' ', // space
22 '\t', // tab
23 '\v', // verticalTab
24 '\f', // formFeed
25 0x0085, // nextLine
26 0x00A0, // nonBreakingSpace
27 0x1680, // ogham
28 0x2000, // enQuad
29 0x2001, // emQuad
30 0x2002, // enSpace
31 0x2003, // emSpace
32 0x2004, // threePerEmSpace
33 0x2005, // fourPerEmSpace
34 0x2006, // sixPerEmSpace
35 0x2007, // figureSpace
36 0x2008, // punctuationEmSpace
37 0x2009, // thinSpace
38 0x200A, // hairSpace
39 0x200B, // zeroWidthSpace
40 0x202F, // narrowNoBreakSpace
41 0x205F, // mathematicalSpace
42 0x3000, // ideographicSpace
43 0xFEFF: // byteOrderMark
44 return true
45 }
46 return false
47}
48
49func IsLineBreak(ch rune) bool {
50 // ES5 7.3:

Callers 15

skipSingleLineWhitespaceFunction · 0.92
getCompletionDataMethod · 0.92
getIfElseOccurrencesMethod · 0.92
findIndentationColumnFunction · 0.92
skipWhiteSpaceSingleLineFunction · 0.92
calculateIndentFunction · 0.92
ScanMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected