Merge pull request #21352 from Microsoft/emitApiDiagnostics

Expose sort and deduplicate diagnostics in Public API
This commit is contained in:
Sheetal Nandi
2018-01-25 08:56:59 -08:00
committed by GitHub
3 changed files with 6 additions and 4 deletions

View File

@@ -16,6 +16,10 @@ namespace ts {
// Update: We also consider a path like `C:\foo.ts` "relative" because we do not search for it in `node_modules` or treat it as an ambient module.
return pathIsRelative(moduleName) || isRootedDiskPath(moduleName);
}
export function sortAndDeduplicateDiagnostics(diagnostics: ReadonlyArray<Diagnostic>): Diagnostic[] {
return sortAndDeduplicate(diagnostics, compareDiagnostics);
}
}
/* @internal */
@@ -1901,10 +1905,6 @@ namespace ts {
return text1 ? Comparison.GreaterThan : Comparison.LessThan;
}
export function sortAndDeduplicateDiagnostics(diagnostics: ReadonlyArray<Diagnostic>): Diagnostic[] {
return sortAndDeduplicate(diagnostics, compareDiagnostics);
}
export function normalizeSlashes(path: string): string {
return path.replace(/\\/g, "/");
}