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

Function removeTrailingWhitespace

internal/parser/jsdoc.go:392–404  ·  view source on GitHub ↗
(comments []string)

Source from the content-addressed store, hash-verified

390}
391
392func removeTrailingWhitespace(comments []string) []string {
393 end := len(comments)
394 for i := len(comments) - 1; i >= 0; i-- {
395 trimmed := trimEnd(comments[i])
396 if trimmed == "" {
397 end = i
398 } else {
399 comments[i] = trimmed
400 break
401 }
402 }
403 return comments[:end]
404}
405
406func (p *Parser) isNextNonwhitespaceTokenEndOfFile() bool {
407 // We must use infinite lookahead, as there could be any number of newlines :(

Callers 2

parseTagCommentsMethod · 0.85

Calls 2

lenFunction · 0.85
trimEndFunction · 0.70

Tested by

no test coverage detected