@@ -8141,8 +8141,7 @@ export function createDetachedDiagnostic(fileName: string, start: number, length
8141
8141
assertDiagnosticLocation ( /*file*/ undefined , start , length ) ;
8142
8142
let text = getLocaleSpecificMessage ( message ) ;
8143
8143
8144
- // TODO(jakebailey): would love to use length here; maybe use some instead?
8145
- if ( args . length > 0 ) {
8144
+ if ( some ( args ) ) {
8146
8145
text = formatStringFromArgs ( text , args ) ;
8147
8146
}
8148
8147
@@ -8212,8 +8211,7 @@ export function createFileDiagnostic(file: SourceFile, start: number, length: nu
8212
8211
8213
8212
let text = getLocaleSpecificMessage ( message ) ;
8214
8213
8215
- // TODO(jakebailey): would love to use length here; maybe use some instead?
8216
- if ( args . length > 0 ) {
8214
+ if ( some ( args ) ) {
8217
8215
text = formatStringFromArgs ( text , args ) ;
8218
8216
}
8219
8217
@@ -8234,7 +8232,7 @@ export function createFileDiagnostic(file: SourceFile, start: number, length: nu
8234
8232
export function formatMessage ( message : DiagnosticMessage , ...args : DiagnosticArguments ) : string {
8235
8233
let text = getLocaleSpecificMessage ( message ) ;
8236
8234
8237
- if ( length ( args ) ) {
8235
+ if ( some ( args ) ) {
8238
8236
text = formatStringFromArgs ( text , args ) ;
8239
8237
}
8240
8238
@@ -8245,7 +8243,7 @@ export function formatMessage(message: DiagnosticMessage, ...args: DiagnosticArg
8245
8243
export function createCompilerDiagnostic ( message : DiagnosticMessage , ...args : DiagnosticArguments ) : Diagnostic {
8246
8244
let text = getLocaleSpecificMessage ( message ) ;
8247
8245
8248
- if ( length ( args ) ) {
8246
+ if ( some ( args ) ) {
8249
8247
text = formatStringFromArgs ( text , args ) ;
8250
8248
}
8251
8249
@@ -8280,7 +8278,7 @@ export function createCompilerDiagnosticFromMessageChain(chain: DiagnosticMessag
8280
8278
export function chainDiagnosticMessages ( details : DiagnosticMessageChain | DiagnosticMessageChain [ ] | undefined , message : DiagnosticMessage , ...args : DiagnosticArguments ) : DiagnosticMessageChain {
8281
8279
let text = getLocaleSpecificMessage ( message ) ;
8282
8280
8283
- if ( length ( args ) ) {
8281
+ if ( some ( args ) ) {
8284
8282
text = formatStringFromArgs ( text , args ) ;
8285
8283
}
8286
8284
return {
0 commit comments