All files / src/modules hacker.js

100% Statements 38/38
100% Branches 7/7
100% Functions 7/7
100% Lines 38/38

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 31 32 33 34 35 36 37 38 391x 1x 22x 22x 1x 1x 2x 2x 1x 1x 9x 9x 1x 1x 8x 8x 1x 1x 9x 9x 1x 1x 3x 3x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
export class Hacker {
  constructor(pure) {
    this.pure = pure;
  }
 
  abbreviation() {
    return this.pure.random.arrayElement(this.pure.registeredModules.hacker.abbreviation);
  }
 
  adjective() {
    return this.pure.random.arrayElement(this.pure.registeredModules.hacker.adjective);
  }
 
  noun() {
    return this.pure.random.arrayElement(this.pure.registeredModules.hacker.noun);
  }
 
  verb() {
    return this.pure.random.arrayElement(this.pure.registeredModules.hacker.verb);
  }
 
  ingverb() {
    return this.pure.random.arrayElement(this.pure.registeredModules.hacker.ingverb);
  }
 
  phrase() {
    const data = {
      abbreviation: this.pure.hacker.abbreviation(),
      adjective: this.pure.hacker.adjective(),
      ingverb: this.pure.hacker.ingverb(),
      noun: this.pure.hacker.noun(),
      verb: this.pure.hacker.verb()
    };
    const phrase = this.pure.random.arrayElement(this.pure.registeredModules.hacker.phrase);
 
    return this.pure.helpers.mustache({ str: phrase, data });
  }
}