1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
10 | exports.SourceFileCache = void 0;
|
11 | class SourceFileCache extends Map {
|
12 | constructor() {
|
13 | super(...arguments);
|
14 | this.angularDiagnostics = new Map();
|
15 | }
|
16 | invalidate(file) {
|
17 | const sourceFile = this.get(file);
|
18 | if (sourceFile) {
|
19 | this.delete(file);
|
20 | this.angularDiagnostics.delete(sourceFile);
|
21 | }
|
22 | }
|
23 | updateAngularDiagnostics(sourceFile, diagnostics) {
|
24 | if (diagnostics.length > 0) {
|
25 | this.angularDiagnostics.set(sourceFile, diagnostics);
|
26 | }
|
27 | else {
|
28 | this.angularDiagnostics.delete(sourceFile);
|
29 | }
|
30 | }
|
31 | getAngularDiagnostics(sourceFile) {
|
32 | return this.angularDiagnostics.get(sourceFile);
|
33 | }
|
34 | }
|
35 | exports.SourceFileCache = SourceFileCache;
|