Handle undefined in indent helper (#38217)
* Handle undefined in indent helper Telemetry shows that it's called with undefined (probably `stderr` in an error scenario?). * Add undefined to parameter type
This commit is contained in:
parent
466d0c0ecb
commit
167f954ec7
1 changed files with 4 additions and 2 deletions
|
@ -246,7 +246,9 @@ namespace ts.server.typingsInstaller {
|
|||
const installer = new NodeTypingsInstaller(globalTypingsCacheLocation!, typingSafeListLocation!, typesMapLocation!, npmLocation, validateDefaultNpmLocation, /*throttleLimit*/5, log); // TODO: GH#18217
|
||||
installer.listen();
|
||||
|
||||
function indent(newline: string, str: string): string {
|
||||
return `${newline} ` + str.replace(/\r?\n/, `${newline} `);
|
||||
function indent(newline: string, str: string | undefined): string {
|
||||
return str && str.length
|
||||
? `${newline} ` + str.replace(/\r?\n/, `${newline} `)
|
||||
: "";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue