export function removeSlashes ( path ) { path = removeLeadingSlashes ( path ) ; path = removeTrailingSlashes ( path ) ; return path ; } export function removeTrailingSlashes ( path ) { return path . endsWith ( '/' ) ? path . slice ( 0 , - 1 ) : path ; } export function removeLeadingSlashes ( path ) { return path . startsWith ( '/' ) ? path . slice ( 1 ) : path ; }