@huukhanhnguyen/model / core/modelSerialize
core/modelSerialize
modelSections()
modelSections(
nodes):Pick<ModelJSON,"parameters"|"objects">
Partition a flat runtime node collection into the persisted sections (empty arrays omitted): value nodes (ParameterNode) and header containers (lane "parameters") → parameters; everything else → objects (body / scene role). THE one partition rule — Model.toJSON and any host that saves a bare NodeCollection (no owning Model) share it.
A body node that is NOT a Group serializes as-is, which is a document the schema rejects by design: SCHEMA 46 has no root operation, and a named validate error ("wrap it in an object") is the right place to say so — silently wrapping one would invent an object the author never wrote, and silently dropping it would lose their work.
Parameters
nodes
NodeCollection<any>
Returns
Pick<ModelJSON, "parameters" | "objects">