vendor tsgo
This commit is contained in:
13
tools/tsgo/internal/modulespecifiers/compare.go
Normal file
13
tools/tsgo/internal/modulespecifiers/compare.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package modulespecifiers
|
||||
|
||||
import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
func CountPathComponents(path string) int {
|
||||
initial := 0
|
||||
if strings.HasPrefix(path, "./") {
|
||||
initial = 2
|
||||
}
|
||||
return strings.Count(path[initial:], "/")
|
||||
}
|
||||
Reference in New Issue
Block a user