import { EntityDefinitionWithOrigin , NarrativeSchema } from "./types" ; export const composeEntityDefinitions = ( narrativeSchema , entityKey , alreadyLoadedEntitiesWithOrigin ) : EntityDefinitionWithOrigin [ ] => { return [ ... alreadyLoadedEntitiesWithOrigin , ... narrativeSchema . data [ entityKey ] . map ( ( labelDefinition ) => ( { ... labelDefinition , origin : narrativeSchema , } ) ) , ] ; } ;