export const normalizePath = ( path ) => { const result = path === '/' ? path : path . endsWith ( '/' ) ? path . slice ( 0 , - 1 ) : path ; return result . startsWith ( '/' ) ? result : `/${ result }` ; } ;