You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** count .. segments in prefix in normalization from index i */
17
+
/** In the normalized path starting from component `i`, counts the number of `..` segments that path starts with. */
16
18
privateintdotdotCountFrom(inti){
17
19
result=0andi=this.getNumComponents()
18
20
or
@@ -29,7 +31,7 @@ abstract class NormalizableFilepath extends string {
29
31
)
30
32
}
31
33
32
-
/** count non-.. segments in postfix in normalization from index 0 to i-1 */
34
+
/** In the normalized path up to (excluding) component `i`, counts the number of non-`..` segments that path ends with. */
33
35
privateintsegmentCountUntil(inti){
34
36
result=0andi=0
35
37
or
@@ -46,6 +48,7 @@ abstract class NormalizableFilepath extends string {
46
48
)
47
49
}
48
50
51
+
/** Gets the `i`th component if that component should be included in the normalized path. */
49
52
privatestringpart(inti){
50
53
result=this.getComponent(i)and
51
54
result!="."and
@@ -60,7 +63,13 @@ abstract class NormalizableFilepath extends string {
60
63
)
61
64
}
62
65
63
-
/** Gets the normalized filepath for this string; traversing `/../` paths. */
66
+
/**
67
+
* Gets the normalized filepath for this string.
68
+
* Normalizes `..` paths, `.` paths, and multiple `/`s as much as possible, but does not normalize case, resolve symlinks, or make relative paths absolute.
69
+
* Th normalized path will be absolute (begin with `/`) if and only if the original path is.
70
+
* The normalized path will not have a trailing `/`.
0 commit comments