Skip to content

rune-langium / core/src / serializeModels

Function: serializeModels()

ts
function serializeModels(models): Map<string, string>;

Defined in: packages/core/src/serializer/rosetta-serializer.ts:388

Serialize multiple RosettaModel nodes, returning a Map of namespace → source text.

Parameters

ParameterTypeDescription
modelsunknown[]Array of duck-typed RosettaModel AST nodes.

Returns

Map<string, string>

Map<namespace, rosettaSource> with one entry per unique namespace.

Remarks

If two models share the same namespace string, the later entry overwrites the earlier one in the result Map without warning.

Use When

  • Batch-exporting a full CDM/DRR workspace to .rosetta files
  • Building a zip archive of serialized models keyed by namespace

Pitfalls

  • Duplicate namespaces are silently overwritten — validate namespace uniqueness before calling this function.

Core packages released under MIT. Studio app released under FSL-1.1-ALv2.