import { sanitizeDestination } from './destination' ; import { Destination } from './destination-service-types' ; import { searchEnvVariablesForDestination } from './destination-from-env' ; import { searchServiceBindingForDestination } from './destination-from-vcap' ; import { getDestinationFromDestinationService } from './destination-from-service' ; import { DestinationFetchOptions , isDestinationFetchOptions } from './destination-accessor-types' ; param destination returns export async function useOrFetchDestination ( destination ) { return isDestinationFetchOptions ( destination ) ? getDestination ( destination ) : sanitizeDestination ( destination ) ; } param options returns export async function getDestination ( options ) { return ( searchEnvVariablesForDestination ( options ) || searchServiceBindingForDestination ( options . destinationName ) || getDestinationFromDestinationService ( options ) ) ; }