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

akoidan / hotkey-hub / 22072516267

16 Feb 2026 05:39PM UTC coverage: 65.192%. First build
22072516267

Pull #45

github

akoidan
ddfasd
Pull Request #45: Develop

141 of 351 branches covered (40.17%)

Branch coverage included in aggregate %.

201 of 364 new or added lines in 59 files covered. (55.22%)

1215 of 1729 relevant lines covered (70.27%)

23.18 hits per line

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

40.74
/src/local/implementation/if-local-handler.ts
1
import {Injectable, Logger} from '@nestjs/common';
1✔
2
import {BaseLocalHandler} from '@/local/base-local-handler';
1✔
3
import {IfLocalCommand} from '@/config/types/local/local-commands';
4
import {UnknownCommand} from '@/config/types/commands';
5
import clc from 'cli-color';
1✔
6
import {EvaluateService} from '@/local/evaluate-serivce';
1✔
7
import {SemaphorService} from '@/semaphor/semaphor-service';
1✔
8

9
@Injectable()
10
export class IfLocalHandler extends BaseLocalHandler {
1✔
11
  constructor(
12
    protected readonly logger: Logger,
23✔
13
    private readonly evaluateService: EvaluateService,
23✔
14
    private readonly semaphoreService: SemaphorService,
23✔
15
  ) {
16
    super();
23✔
17
  }
18

19
  canHandle(command: UnknownCommand): command is IfLocalCommand {
20
    return (command as IfLocalCommand).if !== undefined;
28✔
21
  }
22

23
  async execute(
24
    cmd: IfLocalCommand, combDelayAfter: undefined | number,
25
    combDelayBefore: undefined | number,
26
    tId: string | undefined |null,
27
  ): Promise<void> {
28
    const ifResult = Boolean(this.evaluateService.evaluateExpression(cmd.if));
×
29
    if (ifResult) {
×
30
      this.logger.debug(`If condition evaluated to: ${clc.yellow(String(ifResult))}. Executing if branch`);
×
31
      for (let i = 0; i < cmd.then.length; i++) {
×
NEW
32
        await this.semaphoreService.spawnPromiseChild(`i=${String(i)}`, async() => {
×
NEW
33
          await this.startChain.handle(cmd.then[i], undefined, undefined, tId);
×
34
        });
35
      }
36
    } else if (cmd.else) {
×
37
      this.logger.debug(`If condition evaluated to: ${clc.yellow(String(ifResult))}. Executing else branch`);
×
NEW
38
      for (let i = 0; i < cmd.else!.length; i++) {
×
NEW
39
        await this.semaphoreService.spawnPromiseChild(`e=${String(i)}`, async() => {
×
NEW
40
          await this.startChain.handle(cmd.else![i], undefined, undefined, tId);
×
41
        });
42
      }
43
    } else {
44
      this.logger.debug(`If condition evaluated to: ${clc.yellow(String(ifResult))}. Skipping commands inside`);
×
45
    }
46
  }
47
}
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

© 2026 Coveralls, Inc