Skip to content

Association relationships

AssociationRelationship.directed is resolved to a boolean for association relationships:

interface ArchiRelationship {
directed: boolean | null;
}
  • For an AssociationRelationship, the field is always resolved to a booleanfalse is the native default when the attribute is absent (Archi’s own type default).
  • For every other relationship type, directed is null.
const undirected = model.relationships.filter(
(r) => r.type === 'AssociationRelationship' && r.directed === false,
);
console.log('undirected associations:', undirected.length);