• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

help-me-mom / ng-mocks / 2669be48-d3c8-47f1-9e0c-601da6ef1817

28 Oct 2024 11:18PM CUT coverage: 100.0%. Remained the same
2669be48-d3c8-47f1-9e0c-601da6ef1817

Pull #10314

circleci

web-flow
chore(e2e/min): update dependency @types/node to v20.17.2
Pull Request #10314: chore(e2e/min): update dependency @types/node to v20.17.2

3269 of 3269 branches covered (100.0%)

Branch coverage included in aggregate %.

4834 of 4834 relevant lines covered (100.0%)

8529.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/libs/ng-mocks/src/lib/common/core.def-stack.ts
1
import { mapEntries } from './core.helpers';
1✔
2

3
export default class<K, V> {
1✔
4
  protected stack: Array<Map<K, V>> = [];
3,258✔
5

6
  public constructor() {
7
    this.push();
3,258✔
8
  }
9

10
  public push() {
1✔
11
    this.stack.push(new Map());
18,769✔
12
  }
13

14
  public pop(): Map<V, V> {
1✔
15
    return this.stack.pop() ?? new Map();
15,513✔
16
  }
17

18
  public has(key: K): ReturnType<Map<K, V>['has']> {
1✔
19
    for (let i = this.stack.length - 1; i >= 0; i -= 1) {
131,232✔
20
      if (this.stack[i].has(key)) {
313,137✔
21
        return true;
63,934✔
22
      }
23
    }
24

25
    return false;
67,298✔
26
  }
27

28
  public get(key: K): ReturnType<Map<K, V>['get']> {
1✔
29
    for (let i = this.stack.length - 1; i >= 0; i -= 1) {
64,811✔
30
      if (this.stack[i].has(key)) {
67,563✔
31
        return this.stack[i].get(key);
64,030✔
32
      }
33
    }
34

35
    return undefined;
781✔
36
  }
37

38
  public set(key: K, value: V): this {
1✔
39
    for (let i = this.stack.length - 1; i >= 0; i -= 1) {
87,486✔
40
      this.stack[i].set(key, value);
250,256✔
41
    }
42

43
    return this;
87,486✔
44
  }
45

46
  public merge(resolutions: Map<K, V>): this {
1✔
47
    for (const [key, value] of mapEntries(resolutions)) {
49,550✔
48
      this.set(key, value);
49,550✔
49
    }
50

51
    return this;
2,354✔
52
  }
53
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc