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

eclipse-aascw / aas-core-codegen / 35062787678
85%

Build:
DEFAULT BRANCH: main
Ran 16 Sep 2026 06:19AM UTC
Jobs 3
Files 269
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

16 Sep 2026 06:13AM UTC coverage: 85.322%. Remained the same
35062787678

push

github

web-flow
Index the TypeScript enumeration tables instead of hashing (#693)

A generated TypeScript enumeration is numeric and dense: ``_generate_enum``
emits ``FirstLiteral = 0`` and lets the rest auto-increment, and
``_generate_model_type_enum`` spells out ``Literal = i``. The comment in
``_generate_enum`` has always said what follows from that::

    // We optimize for comparisons instead of stringification.
    // The stringification is delegated to a separate module, with efficient
    // array look-ups to get the actual string value of a literal.

There were no array look-ups. Every literal-to-text table was a ``Map`` keyed
by the literal -- a hash over an integer that is already the index we want::

    const KEY_TYPES_TO_STRING = new Map<AasTypes.KeyTypes, string>([
      [AasTypes.KeyTypes.AnnotatedRelationshipElement, "AnnotatedRelationshipElement"],
      ...
    ]);

Now it is what it claimed to be::

    const DATA_TYPE_DEF_XSD_TO_STRING: readonly string[] = [
      "xs:anyURI", // AnyUri
      "xs:base64Binary", // Base64Binary
      ...
    ];

The literal is named in a trailing comment only where the text does not
already give it away, so ``MODEL_TYPE_TO_STRING`` and ``KEY_TYPES_TO_STRING``
stay bare while ``DATA_TYPE_DEF_XSD_TO_STRING`` stays checkable. That follows
``_generate_over_enum``, which already writes ``yield <Name>0; // Literal``.

Measured on the generated ``aas_core_meta.v3`` code, best of five runs:

    mustKeyTypesToString    8.1 ns/op -> 3.4 ns/op   (2.40x)
    mustModelTypeToString   7.5 ns/op -> 3.4 ns/op   (2.23x)

Nothing public moves. The tables were already module-private, and
``xToString`` / ``mustXToString`` keep their signatures, their ``null``
contract and the same ``Invalid literal of X: ${value}`` message. An
out-of-range cast such as ``<KeyTypes>99`` yields ``undefined`` from the
array exactly as it did from ``Map.get``.

14 of 15 new or added lines in 1 file covered. (93.33%)

33958 of 39800 relevant lines covered (85.32%)

2.56 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
98.85
-1.15% aas_core_codegen/typescript/lib/_generate_stringification.py
Jobs
ID Job ID Ran Files Coverage
1 3.12 - 35062787678.1 16 Sep 2026 06:21AM UTC 269
85.32
GitHub Action Run
2 3.11 - 35062787678.2 16 Sep 2026 06:21AM UTC 269
85.32
GitHub Action Run
3 3.10 - 35062787678.3 16 Sep 2026 06:21AM UTC 269
85.32
GitHub Action Run
Source Files on build 35062787678
  • Tree
  • List 269
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 313ecae8 on github
  • Prev Build on main (#34992909053)
  • Next Build on main (#35064236266)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc