(absPath: string, file: File)
| 432 | } |
| 433 | |
| 434 | private addFile(absPath: string, file: File): File | null { |
| 435 | if (! file || file[fakeSymbol]) { |
| 436 | // Return file without adding it to this.outputFiles. |
| 437 | return file; |
| 438 | } |
| 439 | |
| 440 | const absLowerPath = absPath.toLowerCase(); |
| 441 | |
| 442 | if (has(this.absPathToOutputIndex, absLowerPath)) { |
| 443 | const old = this.outputFiles[ |
| 444 | this.absPathToOutputIndex[absLowerPath]]; |
| 445 | |
| 446 | // If the old file is just an empty stub, let the new file take |
| 447 | // precedence over it. |
| 448 | if (old.implicit === true) { |
| 449 | return Object.assign(old, { |
| 450 | implicit: file.implicit || false |
| 451 | }, file); |
| 452 | } |
| 453 | |
| 454 | // If the new file is just an empty stub, pretend the _addFile |
| 455 | // succeeded by returning the old file, so that we won't try to call |
| 456 | // _combineFiles needlessly. |
| 457 | if (file.implicit === true) { |
| 458 | return old; |
| 459 | } |
| 460 | |
| 461 | } else { |
| 462 | this.absPathToOutputIndex[absLowerPath] = |
| 463 | this.outputFiles.push(file) - 1; |
| 464 | |
| 465 | return file; |
| 466 | } |
| 467 | |
| 468 | return null; |
| 469 | } |
| 470 | |
| 471 | addInputFiles(files: File[]) { |
| 472 | files.forEach(file => { |
no test coverage detected