(moduleName string)
| 689 | } |
| 690 | |
| 691 | func makeIdentifierFromModuleName(moduleName string) string { |
| 692 | moduleName = tspath.GetBaseFileName(moduleName) |
| 693 | var builder strings.Builder |
| 694 | start := 0 |
| 695 | pos := 0 |
| 696 | for pos < len(moduleName) { |
| 697 | ch := rune(moduleName[pos]) |
| 698 | if pos == 0 && stringutil.IsDigit(ch) { |
| 699 | builder.WriteByte('_') |
| 700 | } else if !isASCIIWordCharacter(ch) { |
| 701 | if start < pos { |
| 702 | builder.WriteString(moduleName[start:pos]) |
| 703 | } |
| 704 | builder.WriteByte('_') |
| 705 | start = pos + 1 |
| 706 | } |
| 707 | pos++ |
| 708 | } |
| 709 | if start < pos { |
| 710 | builder.WriteString(moduleName[start:pos]) |
| 711 | } |
| 712 | return builder.String() |
| 713 | } |
| 714 | |
| 715 | func findSpanEndWithEmitContext[T any](c *EmitContext, array []T, test func(c *EmitContext, value T) bool, start int) int { |
| 716 | i := start |
no test coverage detected