mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 07:13:45 -05:00
Merge pull request #21352 from Microsoft/emitApiDiagnostics
Expose sort and deduplicate diagnostics in Public API
This commit is contained in:
@@ -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, "/");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user