import url from 'url' ; import { useApmPluginContext } from '../context/apm_plugin/use_apm_plugin_context' ; export function useKibanaUrl ( path , urlObject ? ) { const { core } = useApmPluginContext ( ) ; return url . format ( { ... urlObject , pathname : core . http . basePath . prepend ( path ) , } ) ; }