code: function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, getCanonicalFileName) {
          var commonPathComponents;
          var failed = ts.forEach(fileNames, function (sourceFile) {
              // Each file contributes into common source file path
              var sourcePathComponents = ts.getNormalizedPathComponents(sourceFile, currentDirectory);
              sourcePathComponents.pop(); // The base file name is not part of the common directory path
              if (!commonPathComponents) {
                  // first file
                  commonPathComponents = sourcePathComponents;
                  return;
              }
              for (var i = 0, n = Math.min(commonPathComponents.length, sourcePathComponents.length); i < n; i++) {
                  if (getCanonicalFileName(commonPathComponents[i]) !== getCanonicalFileName(sourcePathComponents[i])) {
                      if (i === 0) {
                          // Failed to find any common path component
                          return true;
                      }
                      // New common path found that is 0 -> i-1
                      commonPathComponents.length = i;
                      break;
                  }
              }
              // If the sourcePathComponents was shorter than the commonPathComponents, truncate to the sourcePathComponents
              if (sourcePathComponents.length < commonPathComponents.length) {
                  commonPathComponents.length = sourcePathComponents.length;
              }
          });
          // A common path can not be found when paths span multiple drives on windows, for example
          if (failed) {
              return "";
          }
          if (!commonPathComponents) {
              return currentDirectory;
          }
          return ts.getNormalizedPathFromPathComponents(commonPathComponents);
      }
docs: /* @internal