(libFileName string)
| 675 | } |
| 676 | |
| 677 | func getLibraryNameFromLibFileName(libFileName string) string { |
| 678 | // Support resolving to lib.dom.d.ts -> @typescript/lib-dom, and |
| 679 | // lib.dom.iterable.d.ts -> @typescript/lib-dom/iterable |
| 680 | // lib.es2015.symbol.wellknown.d.ts -> @typescript/lib-es2015/symbol-wellknown |
| 681 | components := strings.Split(libFileName, ".") |
| 682 | var path strings.Builder |
| 683 | path.WriteString("@typescript/lib-") |
| 684 | if len(components) > 1 { |
| 685 | path.WriteString(components[1]) |
| 686 | } |
| 687 | i := 2 |
| 688 | for i < len(components) && components[i] != "" && components[i] != "d" { |
| 689 | if i == 2 { |
| 690 | path.WriteByte('/') |
| 691 | } else { |
| 692 | path.WriteByte('-') |
| 693 | } |
| 694 | path.WriteString(components[i]) |
| 695 | i++ |
| 696 | } |
| 697 | return path.String() |
| 698 | } |
| 699 | |
| 700 | func getInferredLibraryNameResolveFrom(options *core.CompilerOptions, currentDirectory string, libFileName string) string { |
| 701 | var containingDirectory string |
no test coverage detected