MCPcopy
hub / github.com/meteor/meteor / addFile

Method addFile

tools/isobuild/import-scanner.ts:434–469  ·  view source on GitHub ↗
(absPath: string, file: File)

Source from the content-addressed store, hash-verified

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 => {

Callers 9

addInputFilesMethod · 0.95
scanFileMethod · 0.95
addPkgJsonToOutputMethod · 0.95
linker.jsFile · 0.45
compiler.jsFile · 0.45
_watchOutputFilesMethod · 0.45
watchPackageFilesFunction · 0.45

Calls 1

hasFunction · 0.85

Tested by

no test coverage detected