(fromDirectory string, to string, options ComparePathsOptions)
| 771 | } |
| 772 | |
| 773 | func GetRelativePathFromDirectory(fromDirectory string, to string, options ComparePathsOptions) string { |
| 774 | if (GetRootLength(fromDirectory) > 0) != (GetRootLength(to) > 0) { |
| 775 | panic("paths must either both be absolute or both be relative") |
| 776 | } |
| 777 | pathComponents := GetPathComponentsRelativeTo(fromDirectory, to, options) |
| 778 | return GetPathFromPathComponents(pathComponents) |
| 779 | } |
| 780 | |
| 781 | func GetRelativePathFromFile(from string, to string, options ComparePathsOptions) string { |
| 782 | return EnsurePathIsNonModuleName(GetRelativePathFromDirectory(GetDirectoryPath(from), to, options)) |
no test coverage detected