MCPcopy Index your code
hub / github.com/microsoft/typescript-go / IsLineBreak

Function IsLineBreak

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

Source from the content-addressed store, hash-verified

47}
48
49func IsLineBreak(ch rune) bool {
50 // ES5 7.3:
51 // The ECMAScript line terminator characters are listed in Table 3.
52 // Table 3: Line Terminator Characters
53 // Code Unit Value Name Formal Name
54 // \u000A Line Feed <LF>
55 // \u000D Carriage Return <CR>
56 // \u2028 Line separator <LS>
57 // \u2029 Paragraph separator <PS>
58 // Only the characters in Table 3 are treated as line terminators. Other new line or line
59 // breaking characters are treated as white space but not as line terminators.
60 switch ch {
61 case
62 '\n', // lineFeed
63 '\r', // carriageReturn
64 0x2028, // lineSeparator
65 0x2029: // paragraphSeparator
66 return true
67 }
68 return false
69}
70
71func IsDigit(ch rune) bool {
72 return ch >= '0' && ch <= '9'

Callers 15

cleanCallbackTextFunction · 0.92
InsertNodeInListAfterMethod · 0.92
InsertAtTopOfFileMethod · 0.92
findIndentationColumnFunction · 0.92
resolveCallExpressionMethod · 0.92
lineEndPosFunction · 0.92
ComputeECMALineStartsSeqFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected