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

akoidan / hotkey-hub / 25969046020

16 May 2026 06:00PM UTC coverage: 69.033% (-0.3%) from 69.332%
25969046020

push

github

web-flow
Merge pull request #59 from akoidan/develop

Develop

171 of 365 branches covered (46.85%)

Branch coverage included in aggregate %.

45 of 73 new or added lines in 10 files covered. (61.64%)

1385 of 1889 relevant lines covered (73.32%)

25.92 hits per line

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

44.83
/src/local/implementation/expression-local-handler.ts
1
import {ConfigService} from '@/config/config-service';
2✔
2
import {Injectable, Logger} from '@nestjs/common';
2✔
3
import clc from 'cli-color';
2✔
4
import {BaseLocalHandler} from '@/local/base-local-handler';
2✔
5
import {ExpressionLocalCommand} from '@/config/types/local/local-commands';
6
import {UnknownCommand} from '@/config/types/commands';
7
import {EvaluateService} from '@/local/evaluate-serivce';
2✔
8
import {VariableResolutionService} from '@/local/variable-resolution.service';
2✔
9

10
@Injectable()
11
export class ExpressionLocalHandler extends BaseLocalHandler {
2✔
12
  constructor(
13
    protected readonly logger: Logger,
24✔
14
    private readonly configService: ConfigService,
24✔
15
    private readonly evaluateService: EvaluateService,
24✔
16
    private readonly variableService: VariableResolutionService,
24✔
17
  ) {
18
    super();
24✔
19
  }
20

21
  canHandle(command: UnknownCommand): command is ExpressionLocalCommand {
22
    return 'expression' in command;
32✔
23
  }
24

25
  /* eslint-disable */
26
  async execute(
27
    command: ExpressionLocalCommand
28
  ): Promise<void> {
29
    const result = this.evaluateService.evaluateExpression(command.expression);
×
NEW
30
    const varToAssign = this.variableService.getValue(command.assignVariable);
×
NEW
31
    this.logger.debug(`Assigning ${result} to ${varToAssign} from evaluating ${command.expression}`);
×
NEW
32
    if (varToAssign.includes('.')) {
×
NEW
33
      const varPath = varToAssign.split('.')
×
34
      const mainVariable = varPath[0];
×
35
      const mainValue = this.configService.getVariables()[varPath[0]];
×
36
      let nextVal = mainValue;
×
37
      for (let i = 1; i < varPath.length - 1; i++) {
×
38
        nextVal = nextVal[varPath[i]]
×
39
      }
40
      nextVal[varPath[varPath.length - 1]] = result;
×
41
      this.configService.setVariable(mainVariable, mainValue);
×
42
    } else {
NEW
43
      this.configService.setVariable(varToAssign, result);
×
44
    }
NEW
45
    this.logger.debug(`${clc.bold.green(varToAssign)}=${clc.yellow(JSON.stringify(result))}`);
×
46
  }
47

48
  /* eslint-enable */
49
}
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