import { VdmNavigationProperty , VdmServiceMetadata , VdmEntity } from '../../vdm-types' ; export function matchEntity ( navProp , service ) { const matchedEntity = service . entities . find ( e => e . entitySetName === navProp . to ) ; if ( ! matchedEntity ) { throw Error ( `Failed to find the entity from the service: ${ JSON . stringify ( service ) } for nav property ${ navProp }` ) ; } return matchedEntity ; }