Tagged union by name - each association entry's elements is typed to the right element shape. Use associations.find((a) => a.name === '___') and TS narrows automatically.
name
elements
associations.find((a) => a.name === '___')
Tagged union by
name- each association entry'selementsis typed to the right element shape. Useassociations.find((a) => a.name === '___')and TS narrows automatically.