All files / src/Page PageSources.ts

80% Statements 8/10
100% Branches 0/0
66.66% Functions 4/6
100% Lines 7/7

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                            187x 187x 187x     16x       16x 16x 16x      
import _ from 'lodash';
 
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));
  }
}