# All files / src/Page PageSources.ts

46.15% Statements 6/13
100% Branches 0/0
16.66% Functions 1/6
60% Lines 6/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    318x

    8x

    8x
    178x
    178x
    178x

     import clone from 'lodash/clone';

    const _ = { clone };

    interface Src {
      to: string,
      from?: string,
    }

    export interface DynamicSrc {
      to: string,
      asIfTo: string,
      from?: string,
    }

    export class PageSources {
      dynamicIncludeSrc: DynamicSrc[] = [];
      staticIncludeSrc: Src[] = [];
      missingIncludeSrc: Src[] = [];

      getDynamicIncludeSrc(): DynamicSrc[] {
        return _.clone(this.dynamicIncludeSrc);
      }

      addAllToSet(set: Set<String>): void {
        this.dynamicIncludeSrc.forEach(dependency => set.add(dependency.to));
        this.staticIncludeSrc.forEach(dependency => set.add(dependency.to));
        this.missingIncludeSrc.forEach(dependency => set.add(dependency.to));
      }
    }