hunk.code_window: export default function() {
     const modulePath = join('src', 'app', 'app.module.ts');
     return ng('generate', 'pipe', 'test-pipe', '--export')
       .then(() => expectFileToMatch(modulePath, /exports: \[\n(\s*)  TestPipePipe\n\1\]/))
       // Try to run the unit tests.
       .then(() => ng('test', '--watch=false'));
   }
hunk.labels: keep keep keep keep replace keep keep keep keep
hunk.after_edit:     .then(() => expectFileToMatch(modulePath, /exports: \[\r?\n(\s*)  TestPipePipe\r?\n\1\]/))
  
hunk.file_path: tests/legacy-cli/e2e/tests/generate/pipe/pipe-module-export.ts
hunk.type: replace
file: /**
   * @license
   * Copyright Google Inc. All Rights Reserved.
   *
   * Use of this source code is governed by an MIT-style license that can be
   * found in the LICENSE file at https://angular.io/license
   */
  import * as ts from 'typescript';
  import { normalizePath } from './paths';
  
  export class SourceFileCache extends Map<string, ts.SourceFile> {
    private readonly angularDiagnostics = new Map<ts.SourceFile, ts.Diagnostic[]>();
  
    invalidate(
      fileTimestamps: Map<string, 'ignore' | number | { safeTime: number } | null>,
      buildTimestamp: number,
    ): Set<string> {
      const changedFiles = new Set<string>();
      for (const [file, timeOrEntry] of fileTimestamps) {
        if (timeOrEntry === 'ignore') {
          continue;
        }
  
        let time;
        if (typeof timeOrEntry === 'number') {
          time = timeOrEntry;
        } else if (timeOrEntry) {
          time = timeOrEntry.safeTime;
        }
  
        if (!time || time >= buildTimestamp) {
          // Cache stores paths using the POSIX directory separator
          const normalizedFile = normalizePath(file);
          const sourceFile = this.get(normalizedFile);
          if (sourceFile) {
            this.delete(normalizedFile);
            this.angularDiagnostics.delete(sourceFile);
          }
          changedFiles.add(normalizedFile);
        }
      }
  
      return changedFiles;
    }
  
    updateAngularDiagnostics(sourceFile: ts.SourceFile, diagnostics: ts.Diagnostic[]): void {
      if (diagnostics.length > 0) {
        this.angularDiagnostics.set(sourceFile, diagnostics);
      } else {
        this.angularDiagnostics.delete(sourceFile);
      }
    }
  
    getAngularDiagnostics(sourceFile: ts.SourceFile): ts.Diagnostic[] | undefined {
      return this.angularDiagnostics.get(sourceFile);
    }
  }
  