elementSet.toEntityRef
The entity reference a diagnostic carries for this set, or null when diagnostics cannot name its kind.
Usage
ElementSet.toEntityRef(s: ElementSet): KernelEntityRef | nullParameters
sElementSetThe element set.
Returns
A KernelEntityRef with the same kind: indices as numbers, edges as "lo:hi" strings, node and connection ids as given, total kept. null for kinds cv and instance and for persistent-id sets.
Guarantees
- it round-trips: ElementSet.fromEntityRef(ref, { revision: s.revision, node: s.node }) deep-equals s for point, prim, vertex, edge, node and connection sets
- ids.length === ElementSet.size(s) for a non-null result
Example
ElementSet.toEntityRef(ElementSet.edges([[3, 1]])) // → { kind: 'edge', ids: ['1:3'] }
ElementSet.toEntityRef(ElementSet.cvs([[0, 0]])) // → null