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

akoidan / hotkey-hub / 22072236661

16 Feb 2026 05:28PM UTC coverage: 65.192%. First build
22072236661

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

41.67
/src/native/native-module.ts
1
import {Inject, Logger, LogLevel, Module, OnModuleInit} from '@nestjs/common';
1✔
2
import {INativeModule, Native} from '@/native/native-model';
1✔
3
import clc from 'cli-color';
1✔
4
import {getAsset, isSea} from 'node:sea';
1✔
5
import {tmpdir} from 'node:os';
1✔
6
import {join} from 'node:path';
1✔
7

8
import {createRequire} from 'node:module';
1✔
9
import {writeFile, mkdtemp} from 'node:fs/promises';
1✔
10
import {LOG_LEVEL} from '@/app/app-model';
1✔
11

12
@Module({
13
  providers: [
14
    Logger,
15
    {
16
      provide: Native,
17
      useFactory: async(): Promise<INativeModule> => {
NEW
18
        if (isSea()) {
×
NEW
19
          const tmp = await mkdtemp(join(tmpdir(), 'sea-'));
×
NEW
20
          const pathOnDisk = join(tmp, 'native.node');
×
NEW
21
          await writeFile(pathOnDisk, Buffer.from(getAsset('native')));
×
NEW
22
          const requireFromHere = createRequire(__filename);
×
23
          // eslint-disable-next-line
NEW
24
          return requireFromHere(pathOnDisk) as INativeModule;
×
25
        }
26
        // eslint-disable-next-line
NEW
27
        const bindings = require('bindings') as any;
×
28
        // eslint-disable-next-line
NEW
29
        return bindings('native') as INativeModule;
×
30
      },
31
    },
32
  ],
33
  exports: [Native],
34
})
35
export class NativeModule implements OnModuleInit {
1✔
36
  constructor(
37
    private readonly logger: Logger,
×
38
    @Inject(Native)
NEW
39
    private readonly native: INativeModule,
×
40
    @Inject(LOG_LEVEL)
NEW
41
    private readonly logLevel: LogLevel
×
42
  ) {
43
  }
44

45
  onModuleInit(): any {
NEW
46
    this.native.setLoggerLevel(['debug' , 'verbose'].includes(this.logLevel));
×
47
    this.logger.log(`Loaded native library from ${clc.bold.green(this.native.path)}`);
×
48
  }
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