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

electrode-io / electrode-native / 7581

24 Apr 2026 09:20AM UTC coverage: 56.608% (-11.2%) from 67.856%
7581

push

Azure Pipelines

web-flow
Merge pull request #1924 from electrode-io/npm-security-audit-fix

3600 of 7762 branches covered (46.38%)

Branch coverage included in aggregate %.

0 of 2 new or added lines in 1 file covered. (0.0%)

1659 existing lines in 112 files now uncovered.

9425 of 15247 relevant lines covered (61.82%)

523.13 hits per line

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

18.18
/ern-api-impl-gen/src/generators/js/ApiImplJsGenerator.ts
1
import { ApiImplGeneratable } from '../../ApiImplGeneratable';
2
import { log, mustacheUtils, PackagePath, Platform, shell } from 'ern-core';
1✔
3
import fs from 'fs-extra';
1✔
4
import path from 'path';
1✔
5

6
export default class ApiImplJsGenerator implements ApiImplGeneratable {
1✔
7
  private regenerateApiImpl: boolean;
8

9
  get name(): string {
10
    return 'ApiImplJsGenerator';
×
11
  }
12

13
  get platform(): string {
UNCOV
14
    return 'js';
×
15
  }
16

17
  public async generate(
18
    apiDependency: PackagePath,
19
    paths: {
20
      apiImplHull: string;
21
      outDirectory: string;
22
    },
23
    reactNativeVersion: string,
24
    plugins: PackagePath[],
25
    apis: any[],
26
    regen: boolean,
27
  ) {
UNCOV
28
    log.debug(`Starting project generation for ${this.platform}`);
×
UNCOV
29
    this.regenerateApiImpl = regen;
×
UNCOV
30
    await this.fillHull(apiDependency, paths, apis);
×
31
  }
32

33
  public async fillHull(apiDependency: PackagePath, paths: any, apis: any[]) {
UNCOV
34
    shell.pushd(shell.pwd());
×
UNCOV
35
    try {
×
UNCOV
36
      const outputDirectory = path.join(paths.outDirectory, 'js');
×
UNCOV
37
      log.debug(`Creating out directory(${outputDirectory}) for JS.`);
×
UNCOV
38
      await fs.ensureDir(outputDirectory);
×
UNCOV
39
      const mustacheFile = path.join(
×
40
        Platform.currentPlatformVersionPath,
41
        'ern-api-impl-gen/resources/js/apiimpl.mustache',
42
      );
43

UNCOV
44
      for (const api of apis) {
×
UNCOV
45
        api.packageName = apiDependency.name;
×
UNCOV
46
        await mustacheUtils.mustacheRenderToOutputFileUsingTemplateFile(
×
47
          mustacheFile,
48
          api,
49
          path.join(outputDirectory, `${api.apiName}ApiImpl.js`),
50
        );
51
      }
52

UNCOV
53
      const indexMustacheFile = path.join(
×
54
        Platform.currentPlatformVersionPath,
55
        'ern-api-impl-gen/resources/js/index.mustache',
56
      );
UNCOV
57
      const apisMustacheView = {
×
58
        apis,
59
      };
UNCOV
60
      await mustacheUtils.mustacheRenderToOutputFileUsingTemplateFile(
×
61
        indexMustacheFile,
62
        apisMustacheView,
63
        path.join(paths.outDirectory, 'index.js'),
64
      );
65
    } finally {
UNCOV
66
      shell.popd();
×
67
    }
68
  }
69
}
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