mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 02:33:53 -06:00
Assert argument is provided to diagnostic (#22992)
This commit is contained in:
parent
a9aca81601
commit
e4a73f3981
@ -1570,10 +1570,10 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
export function formatStringFromArgs(text: string, args: { [index: number]: string; }, baseIndex?: number): string {
|
||||
export function formatStringFromArgs(text: string, args: ArrayLike<string>, baseIndex?: number): string {
|
||||
baseIndex = baseIndex || 0;
|
||||
|
||||
return text.replace(/{(\d+)}/g, (_match, index?) => args[+index + baseIndex]);
|
||||
return text.replace(/{(\d+)}/g, (_match, index?: string) => Debug.assertDefined(args[+index + baseIndex]));
|
||||
}
|
||||
|
||||
export let localizedDiagnosticMessages: MapLike<string>;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user